oracle觸發器的問題

時間 2022-07-12 00:50:02

1樓:

create or replace trigger scoretrigger

after insert or update on t_pms_score

for each row

begin

if(updating and new.m_score<=100 and new.m_score>=99)

then update t_pms_score set m_integral=4;

elseif(updating and new.m_score<=98 and new.m_score>=96)

then update t_pms_score set m_integral=3;

elseif(updating and new.m_score<=95 and new.m_score>=91)

then update t_pms_score set m_integral=2;

elseif(updating and new.m_score<=90 and new.m_score>=85)

then update t_pms_score set m_integral=1;

if(inserting and new.m_score<=100 and new.m_score>=99)

then insert into t_pms_score( m_integral) values(4);

elseif(inserting and new.m_score<=98 and new.m_score>=96)

then insert into t_pms_score( m_integral) values(3);

elseif(inserting and new.m_score<=95 and new.m_score>=91)

then insert into t_pms_score( m_integral) values(2);

elseif(inserting and new.m_score<=90 and new.m_score>=85)

then insert into t_pms_score( m_integral) values(4);

end if;

end;

2樓:

create or replace 觸發器名 alter insert or update

on t_pms_score

begin

update t_pms_score set m_integral=

case when m_score between 85 and 90 then 1

when m_score between 91 and 95 then 2

when m_score between 96 and 98 then 3

when m_score between 99 and 100 then 4

endend

oralce觸發器問題高分,oralce 觸發器問題 高分

1 觸發器裡面不能操作本表,就是 select billtype into bill from test if bill 這個是不能用的。1 如果你是想得到新插入的記錄的值的話,請使用 new.if new.billtype 1 then intbill 1 end 注意語法就是這個樣的,沒有 se...

如何用JK觸發器構成D觸發器電路圖

莊生曉夢 d觸發器的狀態方程是 q d,jk觸發器的狀態方程是 q jq k q。d觸發器有兩種觸發方式 電平觸發和邊緣觸發。前者可以在cp 時鐘脈衝 等於1時觸發,後者主要在cp的前面觸發 正跳0 1 d觸發器的二次狀態取決於d端觸發前的狀態,即二次狀態 d,因此具有設定0和1的兩個功能。對於邊緣...

RS觸發器是如何起抗抖作用的,RS觸發器的抗抖作用

rs觸發器起抗抖作用是因為開關每按壓一次,輸出訊號僅發生一次變化。當按壓按鍵時,s l,r 0,可得出 a 0,a 1,改變了輸出訊號a的狀態。若由於機械開關的接觸抖動,則r的狀態會在0和1之間變化多次,若 r l,由於a 0,因此g2門仍然是 有低出高 不會影響輸出的狀態。同理,當鬆開按鍵時,s端...