tags:

views:

25

answers:

1

My question is as follows:

User name = Admin

Whenever I perform an insert/update/delete operation on a table "a". I need to have a trigger that would insert the username in table "b"

Is that possible?

+2  A: 
create or replace trigger audit_a_trg 
    before insert or update or delete on A
    for each row
begin
    insert into b values (user);
end;
/

Oracle's online documentation is pretty good. You can read the SQL reference here.

edit

user is a function which returns the name of the account which issues the DML. Find out more.

APC
but how will the trigger know the value of the user?
John
Ok I will give it a shot and see :) Thank you
John