select * from ordtaskremeb_log
create table ordtaskremeb_log
(
timeinfo varchar(50),
oldeqid varchar(20),
neweqid varchar(20),
folderno varchar(50),
ordno varchar(50),
testno varchar(50),
l_type varchar(20))
CREATE OR REPLACE TRIGGER ordtask_eqid_TRIGGER
AFTER UPDATE of eqid ON ordtask
for each row
DECLARE
V_TYPE ordtaskremeb_log.L_TYPE%TYPE;
BEGIN
IF INSERTING THEN
--INSERT触发
V_TYPE := 'INSERT';
ELSIF UPDATING THEN
--UPDATE触发
V_TYPE := 'UPDATE';
END IF;
INSERT INTO ordtaskremeb_log(timeinfo,oldeqid,neweqid,folderno,ordno,testno,l_type)
VALUES
(TO_CHAR(SYSDATE,'yyyy-mm-dd hh24:mi:ss'),:old.eqid,:new.eqid,:old.folderno,:old.ordno,:old.testno,V_TYPE); --USER表示当前用户名
END ordtask_eqid_TRIGGER;
原文链接:https://www.f2er.com/oracle/211748.html