Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: PL/SQL Question
Helmut,
I think that the best way will be to try to insert the raw (one index access) and if you can't do that (duplicate key constraint) use the update command.
In case that most of the time you'll have to update, you may try to do it different.
Ronen Levit
Database group manager
Talmai
Tel: +972 8 9460606 #212 Fax: +972 8 9460705 Cell: +972 52 448699
-----Original Message-----
From: Helmut Daiminger [mailto:hdaiminger_at_vivonet.com]
Sent: Wednesday, September 13, 2000 2:58 AM
To: Multiple recipients of list ORACLE-L
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 = 1234). 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
-- 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).Received on Wed Sep 13 2000 - 02:29:05 CDT
![]() |
![]() |