代码如下:
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_SMSSENDError: 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 thenError: 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);

解决方案 »

  1.   

        if :new.sendflag :=0 then
    ,把0 前面的 冒号去掉,改成     if :new.sendflag =0 then
      

  2.   

    还是有报错,第14行还是报错,提示  Error: PLS-00103: 出现符号 "SELECT"在需要下列之一时:…………
      

  3.   

           :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;