convert short to string datatype | Community
Skip to main content
Level 2
January 28, 2020
Solved

convert short to string datatype

  • January 28, 2020
  • 1 reply
  • 2203 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jonathon_wodnicki

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

1 reply

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
January 28, 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