Re: Help Me (Oracel Trigger Problem)

From: Alex J <AlexJent_at_prodigy.net>
Date: Mon, 28 Dec 1998 19:03:19 -0600
Message-ID: <769a1n$c4rc$1_at_newssvr04-int.news.prodigy.com>


Seems to me that this trigger will generate "RAISE_APPLICATION_ERROR(-20500" every time unless you test the insert via SQL%RowCount or something!

James A. Johnson wrote in message <3686DC72.9D5287A5_at_bellsouth.net>...
>You need to provide a little more on this problem. Does it update the
>president or just the people not the president. Also see if the trigger
>is compiled and accurate using enterprise manager.
>
>
>"Kang, Dale" wrote:
>
>> Why this routine don't work ?
>> Please help me!
>> I really appreciate your reading.
>>
>> CREATE OR REPLACE TRIGGER get_hacker
>> BEFORE UPDATE OF sal ON emp
>> FOR EACH ROW
>> WHEN (old.job != 'PRESIDENT')
>> BEGIN
>> INSERT INTO guard(hacker, mod_date, old_sal, new_sal)
>> VALUES(user,
>> to_char(sysdate,'yy/mm/dd hh24:mi:ss'),
>> :old.sal, :new.sal);
>>
>> RAISE_APPLICATION_ERROR(-20500,
>> 'You may olny update Salary of PRESIDENT. !!');
>> END;
>> /
>
Received on Tue Dec 29 1998 - 02:03:19 CET

Original text of this message