Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trigger that gets current user after insert or update

311828Feb 9 2008 — edited Feb 10 2008
Hello and thank you in advance for all you help
I am trying to write a trigger that inserts the user into field v_username after an insert or an update. I currently have a trigger that updates 'lastupdate' field and I am now trying to add onto this trigger by also adding the user
Current trigger is

create or replace TRIGGER "TEST"."TR_X" BEFORE
INSERT OR UPDATE ON "TEST"."TBLX" FOR EACH ROW
BEGIN
IF DBMS_REPUTIL.FROM_REMOTE = FALSE THEN
:NEW.LASTUPDATE := SYSDATE;
END IF;
END;

TblX has fields: ID, ServiceID, Date, Lastupdate, v_username
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2008
Added on Feb 9 2008
4 comments
5,866 views