Checking NULL value...
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration
I am hoping someone can help me. My ESQL/C code is having difficulty
distiquishing between a column with a NULL value and a column = '\\0' (or "")
using a sqlda structure after a FETCH ... USING DESCRIPTOR ...
I have correctly DESCRIBED the statement into the sqlda structure and
allocated the memory accordingly. I have the following table:
CREATE TABLE test ( name char(16), value char(16) );
INSERT INTO test ( name, value ) values ( "test", "" );
INSERT INTO test ( name ) values ( "test1" );
If I use dbaccess and do a SELECT * FROM test WHERE value IS NULL, the row
with name = "test1" is returned.
In my ESQL/C code, immediately before the fetch sqlvar[...].sqlind is NULL
as well as immediately after for both rows. When I use the Informix library
call risnull(), it returns TRUE for both records.
Why is dbaccess able to determine that one row is NULL and the other is a
single character string with a NULL value?
Bryan Hughes
Shutterfly.com
--
------------------------------------------------------------
"A doctor can bury his mistakes but an architect can only
advise his client to plant vines." -- Frank Lloyd Wright