PL/SQL: SQL Statement ignored
21/25 PL/SQL: ORA-00927: missing equal sign
22/2 PL/SQL: SQL Statement ignored
22/31 PL/SQL: ORA-00927: missing equal sign
26/1 PL/SQL: SQL Statement ignored
27/13 PL/SQL: ORA-00927: missing equal sign
32/1 PL/SQL: SQL Statement ignored
33/13 PL/SQL: ORA-00927: missing equal sign
38/1 PL/SQL: SQL Statement ignored
39/13 PL/SQL: ORA-00927: missing equal sign
44/1 PL/SQL: SQL Statement ignored
我想創建一個觸發器,當我插入表4主體的價值會自動計算比例,並設置獎學金的折扣一樣,如果學生有60%然後設置一些盧比折扣,如果80%比設置一些盧比折扣觸發更新值
哪裏是你的代碼?將無法幫助只有錯誤。 – Nitish
創建或更換觸發器vi_insert 更新前ON學生 FOR EACH ROW ENABLE 聲明 t student.total%type; p student.percentage%type; d student.discount%type; vs1 student.s1%類型; vs2 student.s2%類型; vs3 student.s3%type; vs4 student.s4%type; vrno student.rno%type;光標stu是select * from學生; rw stu%rowtype; begin open stu; loop fetch stu into rw; t:= rw.vs1 + rw.vs2 + rw.vs3 + rw.vs4; p:= t * 0.25; 更新學生組總數:= t其中rno:= rw.rno; 更新學生設置百分比:= p其中rno:= rw.rno; –
if(r.p> = 95) then 更新學生 設置折扣:= 25000其中rno:= rw.rno; ----- COND 2 ELSIF(r.p> = 90) 然後 更新學生 組折扣:= 20000,其中RNO:= rw.rno; --- cond 3 elsif(r.p> = 80) 然後 更新學生 設置折扣:= 15000其中rno:= rw.rno; --- cond 4 elsif(r.p> = 75) 然後 更新學生 設置折扣:= 10000其中rno:= rw.rno; ---- cond 5 else 更新學生 設置折扣:= 0其中rno:= rw.rno; end if; 退出 退出stu時未找到; end loop; close stu; vi_insert; 結束; –