Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to define NULL in where clause OCI

322402Dec 29 2003 — edited Mar 19 2004
Hi everyone,
I have a query "select name from emp where job = :JOB"
and i have a certain row where the job is NULL. Now in the OCI docs it says that if a bound variable has to have a NULL value we just have to set the indicator variable to -1. And I did that in the OCIDefineByPos function. But still when I execute I get the no rows found answer.

If I change the query to "select name from emp where job is null" (after removing the bound clause) i get the proper answer. Funny this has to happen because I am able to insert NULLs using OCI this way but not put them in the where clause.

Does this mean that i have to use the "is null" in my SQL? Or am I missing something in the OCIDefineByPos?

Thanks
Kind Regards
Aby Philip
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 16 2004
Added on Dec 29 2003
4 comments
842 views