Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Exist clause in PL/SQL
How about:
declare
dummy integer;
begin
select rownum
into dummy
from table1
where ...
and rownum = 1;
exception
when no_data_found then
insert into table1 ...
end;
Yaron Avior wrote:
>
> Hi,
> Is there in PL/SQL any replacement for SQL-Server's "If exist/If not
> exist" clause?
> I need to do something like : if not exists (select * from Table1
> where Field1=...) Insert into Table1 (Field1, Field2,...) values (...,
> ...,...)
>
> thanks
Received on Mon Nov 12 2001 - 12:35:20 CST
![]() |
![]() |