I am not sure what your question really is.
But I think this would also work:( I hope )
CREATE TRIGGER TEST
BEFORE INSERT OF ACC
FOR EACH ROW
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');
END IF;
END IF;
UPDATE_CLAUSE;
END TEST
Violin <violin.hsiao_at_mail.pouchen.com.tw> schreef in artikel
<35df0eb6.22822445_at_news.twsc.pouchen.com.tw>...
> Hello,
> I want to create a trigger like this:
> CREATE TRIGGER TEST
> BEFORE INSERT OF ACC
> FOR EACH ROW
> 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
> UPDATE_CLAUSE;
> END IF;
> ELSE
> UPDATE_CLAUSE;
> 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 - 07:27:01 CDT