create or replace trigger 触发器名 before/after insert or update or delete on 你的表名 for each row declare action varchar2(200); begin if inserting then action:='insert'; elsif updating then action;='update'; elsif deleting then action:='delete'; else raise_application_error(-20001,'error'); end if;end;
感谢楼主的热心帮助,虽然这不是我要的结果,我要的是所执行的这条SQL语句的完整文本哪位帮帮忙???
自己根据这个表的记录写一个取数据的SQl语句 然后分别在after Insert的时候找出这条记录, after update 和before update 的时候把这些关键的点找出来不就行了吗?但是这只是对个别表,如果你整个系统真是这样的话,那你的系统也别想跑起来!
declare
action varchar2(200);
begin
if inserting then
action:='insert';
elsif updating then
action;='update';
elsif deleting then
action:='delete';
else
raise_application_error(-20001,'error');
end if;end;
然后分别在after Insert的时候找出这条记录,
after update 和before update 的时候把这些关键的点找出来不就行了吗?但是这只是对个别表,如果你整个系统真是这样的话,那你的系统也别想跑起来!