You can add two new columns(eg: chuser,date_stamp) to the existing table to trap the user name and date stamp.
Code:
CREATE OR REPLACE TRIGGER TRIG_TABLEA
before insert or update
on TABLEA
for each row
begin
:new.DATE_STAMP :=sysdate;
:new.chuser := sys_context('userenv','os_user') ;
END;
Otherwise, if you are using another table, it would be along the lines ...
Code:
SQl>create table actions_table (action varchar2(20),....,chuser varchar2(30),date_stamp date); -- you need to capture more info regarding the -- table etc etc, this is just an example
Table created.
CREATE OR REPLACE TRIGGER TRIG_TABLEA
before insert or update
on TABLEA
for each row
begin
insert into actions_table values ('',....,sys_context('userenv','os_user'),sysdate);
END;
Check out the function SYS_CONTEXT(). You can get a lot of info using this.