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!

is null is not working in if statement in PLSQL

Sunny86Jan 22 2019 — edited Jan 22 2019

Hello All,

is null is not working even if the select statement didnt bring any results. Count is working

X varchar2(100) = '';

Xcnt number;

begin

select XID into X from XTable where ID=1;

-- It is working if i count it and change the condition to check if the Xcnt=0 then Xcnt>0 then

end;

if X is NULL

then

-----

end

if X is not null

then

---

end;

Comments
Post Details
Added on Jan 22 2019
5 comments
3,444 views