Scalar Functions with the UniVerse ODBC Driver

I am using the UniVerse ODBC driver to output data from our transactional system to SQL Server 2008. The ODBC driver is installed on Windows Server 2003 and it works fine. I am trying to find syntax help for writing scalar functions like CONVERT.

As I went through the manual, I found the feature is supported. But when I try to write a query like

SELECT CONVERT(ID AS VARCHAR(10)) FROM TableName

      

the request fails with a syntax error. I suspect the ODBC driver does not support this syntax. Any help on this would be much appreciated. Thank.

+3


source to share


1 answer


You will need to format your scalar functions like this:

{fn CONVERT(EXAMPLEFIELD, SQL_VARCHAR )}

      

Therefore, your completed request might look like this:



SELECT {fn CONVERT(ID, SQL_VARCHAR )} FROM TableName

      

I tested a similar query through my ODBC connection to Universe and it didn't produce a syntax error.

I found the following article from Microsoft on explicit ODBC conversions: http://msdn.microsoft.com/en-us/library/windows/desktop/ms715381(v=vs.85).aspx

+6


source







All Articles