Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select Statement
sorry, my answer wasn't really informative ...
how about something like this pseudocode:
declare
cursor c is
select 1
from yourtable
where yourcondition
;
dummy number;
begin
open c;
fetch c into dummy;
if c%found then dosomething
else dosomethingelse
end if;
close c;
end;
... this should only fetch one row.
an exists-query also comes to mind:
select 1
from dual
where exists
(
select null
from yourtable
where yourcondition
)
Received on Fri Apr 21 2006 - 10:25:15 CDT