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: To create the trigger

Re: To create the trigger

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 22 Aug 1998 02:00:13 GMT
Message-ID: <35e016ad.920622@netnews.worldnet.att.net>


To do the update once, declare a function within your trigger. Note my changes to your code below.

Jonathan

On Fri, 21 Aug 1998 06:07:56 GMT,
violin.hsiao_at_mail.pouchen.com.tw (Violin) wrote:

>Hello,
>I want to create a trigger like this:
>CREATE TRIGGER TEST
>BEFORE INSERT OF ACC
>FOR EACH ROW

procedure do_update is
begin
  UPDATE_CLAuSE;
end;
>BEGIN
> IF acc_qty > ord_qty THEN
> SELECT ALLOW_FLAG INTO temp FROM TABLE WHERE ....
> IF temp = 'No' THEN
> raise_application_error(-10000,'You don't orderso much');
> ELSE

              DO_UPDATE;

> END IF;
> ELSE
DO_UPDATE;

> END IF;
>END TEST;
>
>My question is that the 2 UPDATE_CLAUSE are the same.
>If in normal,I type the UPDATE_CLAUSE twice,and compile,
>the trigger is created OK.
>Is there any convenient way but type the UPDATE_CLAUSE twice?
>Please give me some suggestion,Thank you in advance!
>Please Cc to : violin.hsiao_at_mail.pouchen.com.tw,Thanks :)
Received on Fri Aug 21 1998 - 21:00:13 CDT

Original text of this message

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