PLSQL: if the subquery of the variable IN

Is it possible in PL / SQL function something like

IF xVar IN (SELECT yVar
            FROM....)
THEN...

this? thank you

+4
source share
2 answers

No, you probably have something like

select count(*) 
into foo 
from blah
where yVar = xVar

if foo > 0 then ...

Or you can create a function that returns a boolean if that is what you often use

+1
source

You can use FOR-IN with your implicit cursor. I only know the IF-THEN-ELSE statement with the IF statement.

0
source

All Articles