DECLARE
V_unique_id NUMBER;
BEGIN
BEGIN
SELECT uniqueid
INTO v_unique_id
FROM XYZ
WHERE abc = 104440
AND title = 'test'
;
-- other statements ...
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
-- "DIFFERENT INSERT"
END;
END;
END;
-----Original Message-----
From: Dean Lloyd
[mailto:oracledba-ezmlmshield-x19197109.[Email address protected]
Sent: Tuesday, April 03, 2007 8:30 PM
To: LazyDBA Discussion
Subject: Help with Search -> Update ELSE INSERT
Hi Gurus,
I am wondering if anyone could please help out with some ideas on how I
might accomplish this task:
1. Search for record
Select * from XYZ where ABC = 104440 AND TITLE like 'test'
2. If there is a row from the above select statement then find the
'UNIQUEID' for this row
END
OTHERWISE IF NO ROW IS FOUND
EXECUTE "DIFFERENT INSERT"
Any advise much appreciated!
Cheers,
Alphawest Disclaimer
If this communication is not intended for you and you are not an
authorised
recipient of this email you are prohibited by law from dealing with or
relying on the email or any file attachments. This prohibition includes
reading, printing, copying, re-transmitting, disseminating, storing or
in
any other way dealing or acting in reliance on the information.
If you have received this email in error, we request you contact
Alphawest
immediately by returning the email to [Email address protected] and
destroy the original. This email is confidential and may contain
privileged
client information. Alphawest has taken reasonable steps to ensure the
accuracy and integrity of all its communications, including electronic
communications, but accepts no liability for materials transmitted.
Alphawest collects, uses and stores information regarding its customers
from time to time in accordance with its privacy policy located on
www.alphawest.com.au
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
Oracle LazyDBA home page