Modify your code like this
declare
x number;
Begin
Select 1 into x from table a
where...
update table a
set ...
where...
exception when no_data_found then
insert into table a ...
end;
commit;
Mohan.
-----Original Message-----
From: Carlos Barrera
[mailto:oracledba-ezmlmshield-x40769484.[Email address protected]
Sent: Wednesday, April 06, 2005 1:24 PM
To: LazyDBA Discussion
Subject: pl/sql question
the following code is not working properly. when the record doesn't
exist, it's not inserting it. do i have to use another exception instead
of no_data_found?
regards.
begin
update table a
set ...
where...
exception when no_data_found then
insert into table a ...
end;
commit;
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page