RE: pl/sql question

RE: pl/sql question

 

  

Try...

UPDATE table_a
SET ...
WHERE ...;
IF SQL%NOTFOUND THEN
INSERT INTO table_a;
END IF;
COMMIT;

-----Original Message-----
From: Qi cheng
[mailto:oracledba-ezmlmshield-x98145312.[Email address protected]
Sent: Wednesday, April 06, 2005 2:24 PM
To: LazyDBA Discussion
Subject: Re: pl/sql question

no_data_found is for select, not for undate.

On 4/6/2005 1:23 PM, Carlos Barrera
<oracledba-ezmlmshield-x40769484.[Email address protected] wrote:
>
> 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
>
>
>



--------
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