Skip to Main Content

SQL & PL/SQL

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 use IS NOT NULL using dynamic sql

User_B9XGOJul 25 2017 — edited Jul 26 2017

Hi All,

I am passing lv_query to one of the procedures.

It works without adding the condition AND sal IS NOT NULL.

But, when I add it throws the error 'ORA-00908: missing NULL keyword' while parsing query

----piece of code

lv_query := 'select empno,ename from emp

             where ename = '

             ||''''

             ||'SMITH'

             ||''''

             ||'AND sal IS NOT NULL';

Can anyone please suggest the correct way to use IS NOT NULL.

This is just an example.

Thanks,

veronica

This post has been answered by Gaz in Oz on Jul 25 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 23 2017
Added on Jul 25 2017
18 comments
2,642 views