Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: A simple PL/SQL question...
Aiden Fung wrote:
> Hi all,
>
> I'm trying to port a SQL Sever application to Oracle. How do I write the
> following statement in PL/SQL?
>
> IF EXISTS(SELECT 1 FROM table_x WHERE column_a = 'X')
> ... do stuff
Here's one of many ways to do it ...
count integer;
...
select count(*)
into count
from x
where column_a = 'X'
and rownum = 1;
if count > 0 then
do stuff
end if;
-- Richard KuhlerReceived on Fri May 14 2004 - 21:04:41 CDT
![]() |
![]() |