各位大虾,请问oracle 10g的触发器 使用insert 或update事件触发
(insert或update后触发),能否在触发器的代码中取出所insert或update的具体记录,然后使用该记录对其他表进行操作,如果可以,有参考代码希望能给参考一下。谢谢。
当然是可以的,:
[code="sql"]
Create Or Replace Trigger t_trigger1
After insert or Update On table1
referencing old as old new as new
For Each Row
declare
--需声明使用自治事务
pragma autonomous_transaction;
...
Begin
--取旧值:old. 取新值:new.
stroldstage_com := 'TLCC-' || :old.stage;
strnewstage_com := 'TLCC-' || :new.stage;
...
End;
[/code]
:old和:new,你查查嘛