代碼如下:
create or replace trigger tri_ins_smssend
before insert on SEND
for each row
begin
if :new.mobile_to like '0086%' then
:new.mobile_to := substr(:new.mobile_to,5);
end if;
if :new.mobile_to like '+86%' then
:new.mobile_to := substr(:new.mobile_to,4);
end if;
if :new.sendflag :=0 then
null;
else
:new.pre_send_time := (select trunc(sysdate+1) + 9/24 + 30/(24*60) from dual);
end if;
end;
報錯提示:
Compilation errors for TRIGGER CWXM.TRI_INS_SMSSEND
Error: PLS-00103: 出現符號 "="在需要下列之一時:
. ( * @ % & = - + < / > at in
is mod remainder not rem then <an exponent (**)>
<> or != or ~= >= <= <> and or like like2 like4 likec between
|| indicator multiset member submultiset
符號 "*在 "=" 繼續之前已插入。
Line: 11
Text: if :new.sendflag :=0 then
Error: PLS-00103: 出現符號 "SELECT"在需要下列之一時:
( - + case mod new not
null <an identifier> <a double-quoted delimited-identifier>
<a bind variable> continue avg count current exists max min
prior sql stddev sum variance execute forall merge time
timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<一個帶有字符集說明的可帶引號的字串文字>
<一個可帶引號的 SQL 字串> purge
Line: 14
Text: :new.pre_send_time := (select trunc(sysdate+1) + 9/24 + 30/(24*60) from dual);
Error: PLS-00103: 出現符號 ")"在需要下列之一時:
. , @ ; for <an identifier>
<a double-quoted delimited-identifier> group having intersect
minus order partition start subpartition union where connect
sample
Line: 14
Text: :new.pre_send_time := (select trunc(sysdate+1) + 9/24 + 30/(24*60) from dual);
uj5u.com熱心網友回復:
if :new.sendflag :=0 then,把0 前面的 冒號去掉,改成
if :new.sendflag =0 then
uj5u.com熱心網友回復:
還是有報錯,第14行還是報錯,提示 Error: PLS-00103: 出現符號 "SELECT"在需要下列之一時:…………uj5u.com熱心網友回復:
:new.pre_send_time := (select trunc(sysdate+1) + 9/24 + 30/(24*60) from dual);改成
select trunc(sysdate+1) + 9/24 + 30/(24*60) into :new.pre_send_time from dual;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/99322.html
標籤:開發
