Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: PL/SQL Question
Hi,
begin
=2E..
Update table
set ....
where PrimaryKey =3D 1234
if sql%notfound then insert ...
=2E...
end;
Hope this helps
Davide
-----Original Message-----
From: Helmut Daiminger hdaiminger_at_vivonet.com
Sent: Tue, 12 Sep 2000 16:57:35 -0800
To: ORACLE-L_at_fatcity.com
Subject: PL/SQL Question
Hi!
I do have a weird problem to solve. I wanna check if a specific record
already exists in a table (select * from table where PrimaryKey =3D 1234)=
=2E If
it does, I wanna do an update on that record and if it doesn't, I wanna
insert a record.
What would be the best (and least expensive) way to achieve this in a procedure?
Thanks,
Helmut
--=20
Author: Helmut Daiminger
INET: hdaiminger_at_vivonet.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
_________________________________________________________________________=__
![]() |
![]() |