Trigger question. [message #76422] |
Tue, 18 June 2002 14:58 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Brett
Messages: 7 Registered: October 2001
|
Junior Member |
|
|
Hi,
I have a trigger that runs after an insert. How do i get values of columns that were just inserted?
E.g.
when i insert something into table1, i want to update table2. My query so far looks something like this:
update table2 set t2Col = x where table2.priKey = <#table1.FK#>
In this case, i need to get the value of <#table1.FK#> from the row that was inserted and ran the trigger.
|
|
|
Re: Trigger question. [message #76445 is a reply to message #76422] |
Thu, 04 July 2002 03:23 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Ismail
Messages: 3 Registered: April 2002
|
Junior Member |
|
|
hi,
In your update statement you have to say like this
update TABLE2 set TABLE2.col=:new.TABLE1.col
Example
-------
update allowances set hra=:new.salary*0.2 where deptno=:new.dno
|
|
|