Reputation: 121
Is it possibile in PL/SQL function something like
IF xVar IN (SELECT yVar
FROM....)
THEN...
this? Thank you
Upvotes: 4
Views: 7735
Reputation: 1086
You can use FOR-IN with your implicit cursor. I know only IF-THEN-ELSE operator with IF expression.
Upvotes: 0
Reputation: 196
No, you will probably have to so something like
select count(*)
into foo
from blah
where yVar = xVar
if foo > 0 then ...
Or you could make a function that returns boolean if this is something you'd use often
Upvotes: 3