Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> RE: PL/SQL: how to let it continue when unique constraint violate d

RE: PL/SQL: how to let it continue when unique constraint violate d

From: Frederic Bidon <fbi_at_mobilix.dk>
Date: Tue, 25 Jan 2000 21:29:57 +0100
Message-ID: <2D3005375CAED31199D00008C784963F02090F@ms02.mobilix.dk>


Quite simple, dude : use an exception handler in a nested block

FOR my_row IN (SELECT blah blah) LOOP

	BEGIN
		INSERT INTO ... VALUES(my_row.x, my_row.y, ....);
	EXCEPTION
		WHEN -1 THEN
			NULL; -- or do something, like print a msg
		WHEN OTHERS THEN
			...
	END;

END LOOP; Clear enough ?

Regards,

Frederic

-----Original Message-----
From: Jeff [mailto:kit_at_cintec.cuhk.edu.hk] Sent: 20. januar 2000 18:22
To: comp.databases.oracle.server_at_list.deja.com Subject: PL/SQL: how to let it continue when unique constraint violated

 Message from the Deja.com forum:
 comp.databases.oracle.server
 Your subscription is set to individual email delivery

Hi,

How to let the PL/SQL continue to run when I select some rows and insert them to another table, without quited immediately when unique constraint is violated, such that the other records can still be inserted?

Jeff



 Deja.com: Before you buy.
 http://www.deja.com/

 Sent via Deja.com http://www.deja.com/  Before you buy. Received on Tue Jan 25 2000 - 14:29:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US