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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help : Trigger error, Please

Re: Help : Trigger error, Please

From: Igor Kirasirov <kir_at_aix.krid.crimea.ua>
Date: 1998/05/04
Message-ID: <354DEA27.A98DBCEA@aix.krid.crimea.ua>#1/1

Laurent wrote:
>
> Hi,
>
> I received these errors messages when I run the following trigger :
>
> create trigger contract_1
> before insert on contract
> for each row
> declare
> two_contract_error exception;
> test number;
> begin
> select count(contract_no)
> into test
> from contract
> where (cust_no = :new.cust_no and
> Real_date_in is NULL);
> if (test <> 0) then
> raise two_contract_error;
> end if;
> exception
> when two_contract_error then
> raise_application_error(-20671, 'This client already has a car
> on loan, rental refused');
>
> end;
> /
>
> I do receive the following errors :
>
> SQL> @ test2;
> insert into contract values(
> *
> ERROR at line 1:
> ORA-20671: This client already has a car
> on loan, rental refused
> ORA-06512: at "OPS$CS95LP.CONTRACT_1", line 15
> ORA-04088: error during execution of trigger 'OPS$CS95LP.CONTRACT_1'
>
> SQL>
>
> I do understand the first one but not
> the number 06512 and 04088
>
> In the book i only have this help :
>
> --ORA-06512 at str line num
>
> Cause:
> This is usually the last of a message stack and indicates where a
> problem occurred in
> the PL/SQL code.
>
> Action:
> Fix the problem causing the exception or write an exception
> handler for this condition.
> It may be necessary to contact the application or database
> administrator.
>
> Please help, itis very urgent
>

It's normal situation. Your trigger raise application error. You need define exception entry for this error in block where you enter INSERT statement.

-- 

With best regards,
Igor Kirasirov

                    --oOo--

   Igor Kirasirov            mailto:kir_at_aix.krid.crimea.ua       
 Simferopol, Crimea          voice : work  +38-0652-521-032
     Ukraine                         home  +38-0652-275-956
Received on Mon May 04 1998 - 00:00:00 CDT

Original text of this message

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