Re: trigger - help newbie!

From: Steve Long <slong3_at_mediaone.net>
Date: Fri, 17 Aug 2001 02:46:38 GMT
Message-ID: <iA%e7.1609$L8.23391_at_typhoon.jacksonville.mediaone.net>


this depends on how/when you are examining the value. since you have an "after insert" trigger, you will not see the new value until a COMMIT is issued. sounds like autocommit is not on. thus, after running the PL/SQL block, issue a COMMIT, and then check the value.

"sien" <linda_68_at_hotmail.com> wrote in message news:31d3e92a.0108160029.27f5e54b_at_posting.google.com...
> Hi!
> I'm a newbie in PL/SQL.
> I'm trying to write a trigger which has to update a specific row from
> a table after someone insert a new row into the same table.
> This is my code:
>
> CREATE OR REPLACE TRIGGER CHG_DATE_TEST
>
> after INSERT ON emp
>
> BEGIN
> update emp
> set emp.hiredate=sysdate
> where (empno=7566);
>
> end CHG_DATE_TEST;
>
> it doesn't work, the trigger doesn't change the row I want to update
> (where empno=7566), but it updates the hiredate from the new
> (inserted)row.
>
> Thanks for any help.
>
> Sien
Received on Fri Aug 17 2001 - 04:46:38 CEST

Original text of this message