Scalar functions with UniVerse ODBC driver

Go To StackoverFlow.com

3

I am using the UniVerse ODBC driver to pull 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 some help on the syntax for writing the scalar functions such as CONVERT.

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

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

the query fails with syntax error. I am suspecting that the ODBC driver does not support this syntax. Any help with this will be highly appreciated. Thanks.

2012-04-04 17:13
by rvphx


6

You will need to format your scalar functions like so:

{fn CONVERT(EXAMPLEFIELD, SQL_VARCHAR )}

Therefore, your completed query may look like:

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

I tested a similar query through my ODBC connection to Universe and it did not result in a syntax error.

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

2012-04-04 18:30
by webthaumaturge
Thank you very much! That works as expected - rvphx 2012-04-04 19:37
Ads