我有一个触发器,我想在其中计算DML操作后受影响的行数,并用dbms输出数量。
create or replace trigger log_tr
after
update or
insert or
delete
on table_name
for each statement
declare
v_operation varchar2(10):=
case
when updating then 'update'
when deleting then 'delete'
when inserting then 'insert'
end;
v_operation_count number:=0;
begin
if updating or inserting or deleting then
insert into log_table
values (
user,
sysdate,
v_operation
);
end if;
end log_tr;
如何解决这个问题?预先谢谢你