patrickl
asked on
Oracle sequence number ODBC problem
I'm trying to get the next sequence number from an Oracle sequence with:
SELECT WRV.WRV_SEQ_ADRESSEN.NEXTV AL FROM DUAL
This works fine with the Oracle ODBC drivers from Oracle, but not with those from microsoft. Miscrosoft gives an "value out of range" error (error 22003) for sequences with high numbers.
I checked the ODBC trace for both drivers and it appears that the Microsft versions see the NEXTVAL column as a SQL_C_SHORT (5 positions) where Oracle sees it as a SQL_C_DOUBLE (8 positions).
Unofrtunately the target machine has only Microsoft ODBC drivers so I'm stuck with those.
How do I tell the Microsoft ODBC driver for Oracle to use a larger datatayp for the NEXTVAL column?
How can I instruct
SELECT WRV.WRV_SEQ_ADRESSEN.NEXTV
This works fine with the Oracle ODBC drivers from Oracle, but not with those from microsoft. Miscrosoft gives an "value out of range" error (error 22003) for sequences with high numbers.
I checked the ODBC trace for both drivers and it appears that the Microsft versions see the NEXTVAL column as a SQL_C_SHORT (5 positions) where Oracle sees it as a SQL_C_DOUBLE (8 positions).
Unofrtunately the target machine has only Microsoft ODBC drivers so I'm stuck with those.
How do I tell the Microsoft ODBC driver for Oracle to use a larger datatayp for the NEXTVAL column?
How can I instruct
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the ODBC drivers have different data type representations, and while the ORACLE driver knows the data types, the one of MS does some kind of approximation :-(
Glad I could help.
CHeers
Glad I could help.
CHeers
ASKER
I guess ODBC is just a minefield. I always keep running into trouble with it. The oracle drivers never seem to install and the Microsoft ones don't always work.
But anyway, many thanks.
Just to be complete. I change the query to:
SELECT to_char(WRV.WRV_SEQ_ADRESS EN.NEXTVAL ) AS NEXTVAL FROM DUAL
To make it equivalent to the one I had before. Works like a charm.
But anyway, many thanks.
Just to be complete. I change the query to:
SELECT to_char(WRV.WRV_SEQ_ADRESS
To make it equivalent to the one I had before. Works like a charm.
ASKER
Do you have an idea why this goes wrong at all?