create or replace trigger trg_dept
before insert or update or delete on dept
declare
v_now varchar2(30);
begin
v_now:=to_char(sysdate,'yyyy-mm-dd hh24:mi:ss');
case
when inserting then
dbms_output.putline(v_now||'對dept表進行了insert操作。');
when updating then
dbms_output.putline(v_now||'對dept表進行了update操作。');
when deleting then
dbms_output.putline(v_now||'對dept表進行了delete操作。');
end case;
end;
uj5u.com熱心網友回復:
create or replace trigger trg_deptbefore insert or update or delete on dept
declare
v_now varchar2(30);
begin
v_now:=to_char(sysdate,'yyyy-mm-dd hh24:mi:ss');
if inserting then
dbms_output.putline(v_now||'對dept表進行了insert操作。');
elsif updating then
dbms_output.putline(v_now||'對dept表進行了update操作。');
elsif deleting then
dbms_output.putline(v_now||'對dept表進行了delete操作。');
end if;
end;
uj5u.com熱心網友回復:
我找到了問題了,其實我沒仔細看,就是put_line 沒有加中間的下劃線而已!轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/57082.html
標籤:基礎和管理
上一篇:oracle 兩個詭異的問題
