Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> NULL value processing with SQLGetData for LONG datatype.

NULL value processing with SQLGetData for LONG datatype.

From: Keith Jensen <kjensen_at_ellora.com>
Date: Sat, 31 Oct 1998 01:28:03 GMT
Message-ID: <363A670C.DDA28B4F@ellora.com>


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

--



  Keith Jensen Ellora Software Inc.
  kjensen_at_ellora.com 7 Bean St, Bldg. 2602   (508)784-1153 Devens, MA 01433
  FAX:(508)784-1160
Received on Fri Oct 30 1998 - 19:28:03 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US