Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

convert short to string datatype

Avatar

Avatar
Validate 1
Level 1
rupesh12
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
View profile

Avatar
Validate 1
Level 1
rupesh12
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
View profile
rupesh12
Level 1

27-01-2020

Hi,

 

In update data activity, I'm getting below error:

ODB-240000 ODBC error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Argument data type smallint is invalid for argument 1 of substring function. SQLState: 37000

 

Here source field has short datatype and destination has string datatype.

Using ToString(), I tried to convert short to string but its not working.

 

Please let me know how to resolved the issue.

 

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
wodnicki
MVP

Likes

941 likes

Total Posts

1,061 posts

Correct Reply

499 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile

Avatar
Contributor
MVP
wodnicki
MVP

Likes

941 likes

Total Posts

1,061 posts

Correct Reply

499 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile
wodnicki
MVP

28-01-2020

Hi,

 

Are you using ToString() inside the Substring, and offset counting from 1?

Substring(ToString(@short), 1, 1) works fine in postgres, translates to Substr(text(X0.iShort), 1, 1)

 

Thanks,

-Jon

Answers (0)