Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Coding for ORA-02291 in Pl/SQL
On 31 Jan 2005 14:04:30 -0800, "dfosgate_at_llbean.com"
<dfosgate_at_llbean.com> wrote:
>Hi,
>
>I want to trap an execption from a table insert where the Oracle
>exception code will be ORA-02291 . Can I code the exception as follows:
>
>--
>-- INSERT INTO PRICE_LIST_DTL for CATG within CLASS
No it won't
You need to have the following in your code
declare
exception_to_be_trapped exception;
pragma exception_init(-2291, exception_to_be_trapped);
begin
<< etc>>
exception
when exception_to_be_trapped then
-- Sybrand Bakker, Senior Oracle DBAReceived on Mon Jan 31 2005 - 16:22:15 CST
![]() |
![]() |