Help with NULLs in Where Clause in E/SQL
Posted in 1995
Topics: General Discussion
I am using SQL Descriptors in E/SQL C. I am trying to tell an already
prepared SQL statment that a field in the where clase is NULL. But it
does not seem to work. The statment looks like this:
select * from t1 where f1 = ?;
I get screen input and set up my descriptor like so:
SET DESCRIPTOR "mydesc" VALUE 1 DATA= :f1_data, TYPE=SQLCAHR,
SIZE=:f1_size;
This works fine. But when I do the following for a null value in field
2, no rows are returned (there is data there).
indval=-1;
SET DESCRIPTOR "mydesc" VALUE 1 INDICATOR = :indval;
Before I enter the screen I prepare and describe my SQL so all I have
to do is set the descriptor and open the cursor. I don't want to have
to reparse my SQL and make a special case for NULL data on my where
clause.
Any suggestions or comments would be appreciated. Post here or send
email to kurt@hteinc.com. TIA.
Kurt Kessel
HTE, Inc.
kurt@hteinc.com