I have a cursor where i am passing a flag and inside that cursor ,i am using following condition
cursor abc (c_flag )
IS
select 1
from pqr p
where p.c1 = CASE c_flag ='Y'
THEN p.c1
ELSE IS NOT NULL
END
Now the issue is that the ELSE case won’t work for me since it should be written like p.c1 IS NOT NULL, rather than p.c1 = IS NOT NULL.
I think you got what i want to do, if c_flag is yes, I’ll take all the records, and if not then pick all not null records.
I am using Oracle as RDBMS.
1 Answer