Which rows broke my constraint?

From: Lee Pollington <lee_at_cursci.co.uk>
Date: Tue, 25 Aug 1998 11:38:24 +0100
Message-ID: <35E2941F.E4CA01D0_at_cursci.co.uk>



Hi,

I want to know if Oracle keeps the RowID's or something of rows that break a unique index. I have a table which has a unique index across 3 columns: a foreign key and two number columns. If the uniqueness of this index is broken by an insertion/update to this table an exception is raised as a duplicate value on an index. I want to be able to find out from Oracle which rows conflicted with the update/insertion.

I thought that Oracle might do something like this as I saw in the docs that you can add an 'exceptions into EXCEPTIONS' clause to an enable constraint command, which puts the RowID's of the rows that broke the constraint.

I thought that maybe there would be a cursor passed into a trigger PL/SQL
block, but have not been able to find anything.

Any help will be much appreciated.
thanks
Lee Pollington
email: lee_at_biomednet.com Received on Tue Aug 25 1998 - 12:38:24 CEST

Original text of this message