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: What's wrong with the trigger?

Re: What's wrong with the trigger?

From: Keith McKendry <mckendry_at_execpc.com>
Date: Thu, 20 Aug 1998 14:47:33 -0500
Message-ID: <35DC7D55.AE2857E0@execpc.com>


After your attempted compile of the trigger, you can find the error(s) by selecting from the user_errors view.

Keith McKendry
Whittman-Hart, Inc.

Violin wrote:

> Hello,
> I want to create a trigger for the next purpose:
> When I insert into ACCEPT,check the column value ORD_ISS of MORDER,
> if ORD_ISS is null,update MORDER set ORD_ISS = ACCEPT.ACCEPT_QTY;
> else update MORDER set ORD_ISS = ORD_ISS + ACCEPT.ACCEPT_QTY;
>
> And the script is:
> CREATE OR REPLACE TRIGGER INS_ACCEPT
> AFTER INSERT
> ON ACCEPT
> FOR EACH ROW
> DECLARE
> iss_temp NUMBER;
> accept_temp NUMBER;
> BEGIN
> SELECT ORD_ISS INTO iss_temp FROM MORDER
> WHERE (ORD_NO = :new.ord_no AND
> ORD_NUM = :new.ord_num);
> IF iss_temp IS NULL THEN
> UPDATE MORDER SET ORD_ISS = :new.accept_qty
> WHERE (ORD_NO = :new.ord_no AND
> ORD_NUM = :new.ord_num);
> ELSE
> accept_temp := :new.accept_qty;
> accept_temp := accept_temp + iss_temp;
> UDPATE MORDER SET ORD_ISS = accept_temp
> WHERE (ORD_NO = :new.ord_no AND
> ORD_NUM = :new.ord_num);
> END IF;
> COMMIT;
> END INS_ACCEPT;
> /
>
> But when I compile the script in SQL*Plus,there's an error:
> Warning: Trigger created with compilation errors.
> What's wrong with my trigger?
> Please give me some tips,Thank you in advance!
> Please Cc to : violin.hsiao_at_mail.pouchen.com.tw,Thank you :)
Received on Thu Aug 20 1998 - 14:47:33 CDT

Original text of this message

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