6
of 38
procedure
p_log_audit
(
who varchar2,
what varchar2,
descr_tx varchar2,
when_dt date)
is
Pragma autonomous_transaction
;
Begin
commit
;
...
end
;
insert into
Audit_emp
values
(audit_seq.
nextval
,
what,descr_tx,who,when_dt);
Simple example of
autonomous transaction
u
trigger Bu_emp
u
before update
u
of sal on Emp
u
for each row
u
begin
u
p_log_audit
u
(user,
u
'update',
u
'update of
emp.salary',
sysdate);
u
end;
1
2
3
4