Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> NULL value processing with SQLGetData for LONG datatype.
I am using the Oracle ODBC driver version 8.00.0300 with an Oracle8
server. I have been able to use
SQLGetData to get LONG columns with non-NULL values, however things
breakdown when retrieving
NULL values.
The first issue is that the driver is not returning SQL_NULL_DATA in the
value length parameter. Instead
SQLGetData returns an error status. Calls to SQLError return native
error 1405 with a message text of
'ORA-01405: fetched column value is NULL'. Okay, I can deal with it,
just trap the error and check it
instead of relying on getting SQL_NULL_DATA in the length indicator.
Unfortunately, I am sometimes getting native error1002 instead with a
message text of
'ORA-01002: fetch out of sequence'.
Does the Oracle ODBC drive not support returning NULL values for LONG datatype columns?
Also, I tried passing 0 in the param for the length of the output buffer
hoping the driver would deal with this
way of doing it better. When doing it this way I always get SQL_NO_TOTAL
in the length indicator and
a return status of SQL_SUCCESS_WITH_INF0, even for non-NULL values. The
SQL_SUCCESS_WITH_INFO
just indicates that the data was truncated.
Both ways of doing this work flawlessly with SQL Server. Why doesn't it
work with Oracle? I have been
forced to use VARCHAR(4000) for the time being to work around this.
Thanks for any help.
Keith Jensen
--