Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Help writing simple trigger.
For some reason I can't figure out how to write a simple
trigger but I know it's very common so I'll ask for some help.
It's a busy day!
This trigger updates user_name and lastedit_date on a table during and update or insert operation for each row and maybe fill in the pk with a sequence number.... CREATE TRIGGER UPD_TRG BEFORE INSERT OR UPDATE ON dbstruct BEGIN user_name=user lastedit_date=sysdate recno=dbstructseq.nextval END;
When I write my function I get table is mutating error. It should operate in the same transaction as the insert update.
I.E. 1 update staement+trigger = 1 transction...=1 SQL parse..
Thank You very much!!!!
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Feb 26 1999 - 05:14:33 CST
![]() |
![]() |