Catching Constraint Violations in PL/SQL
From: Martin Bach <martin_bach_at_t-online.de>
Date: 13 Mar 2003 02:42:35 -0800
Message-ID: <d1bc17cb.0303130242.4274e8a2_at_posting.google.com>
Date: 13 Mar 2003 02:42:35 -0800
Message-ID: <d1bc17cb.0303130242.4274e8a2_at_posting.google.com>
Hi there!
Is there a standard way to catch a constraint violation on PL/SQL?
I've got something like this:
declare
exception
In the docs, I found a few predefined exceptions (like ZERO_DIVIDE),
but no CONSTRAINT_VIOLATED or something similar. DBMS_STANDARD does
not define this either, and "PRAGMA EXCEPTION_INIT()" is for user
defined exceptions only. So which way is there to catch a constraint
violation?
TIA,
...
begin
constraint_violation( a,b,c);
when others then
...
end;