Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers
"William F. O'Neill" wrote:
> Can someone supply me with an example of a Trigger as used on an Oracle
> database, eg. a trigger that would update an audit table, depending on
> whether the action on a table was Update, Delete, or Insert. To clarify,
> if I edit Table_A, I want the trigger to activate, bring up the Audit
> table, and indicate in an Action field that Table_A was just Updated,
> and that a particular field's value changed ->new value, and what the
> old value was. If you have any code that is in anyway similar to my
> requirements, I'd appreciate it. thank you.
> Bill....
create or replace trigger table_a_t1
before delete or insert or update of bstring on table_b
begin
insert into table_a values('change to b',sysdate);
end;
Maybe if you did 'after delete or insert or update' you could insert the old
value
from table_b to table_a? I haven't tried it though.
-Laurie Received on Thu Sep 02 1999 - 17:02:35 CDT
![]() |
![]() |