Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
sqlplus触发器编译错误_Sql_Triggers_Sqlplus - Fatal编程技术网

sqlplus触发器编译错误

sqlplus触发器编译错误,sql,triggers,sqlplus,Sql,Triggers,Sqlplus,是语法错误,还是代码中缺少空格或“:”。下面是我创建触发器的代码 SQL> Create or replace trigger trig_addr_mulund 2 After insert or update 3 On users_table 4 For each row 5 begin 6 If :new.address like 'Mulund' then 7 Insert into D12B_

是语法错误,还是代码中缺少空格或“:”。下面是我创建触发器的代码

  SQL> Create or replace  trigger trig_addr_mulund
      2  After insert or update
      3  On users_table
      4  For each row
      5  begin
      6  If :new.address like 'Mulund' then
      7  Insert into D12B_A23.user_mulund@ralink values (:new.id,:new.role_id,:new.b
    ranch_id,:new.name,:new.email,:new.phone,:new.address,
      8  :new.email,:new.phone,:new.address);
      9  Else
     10  Insert into D12B_A14.user_not_mulund@rslink values (:new.id,:new.role_id,:n
    ew.branch_id,:new.name,:new.email,:new.phone,:new.address,
     11  :new.email,:new.phone,:new.address);
     12  End if
     13  End;
     14  /

Warning: Trigger created with compilation errors.

如果

由于您正在进行直接比较,请使用
=
而不是像
那样使用
。
此外,建议在SQL语句中显式提供列名

CREATE OR REPLACE TRIGGER trig_addr_mulund AFTER
  INSERT OR
  UPDATE ON users_table FOR EACH row
BEGIN 
  IF :new.address = 'Mulund' THEN    -- changed "LIKE" to "="
  INSERT
  INTO D12B_A23.user_mulund@ralink VALUES
    (
      :new.id,
      :new.role_id,
      :new.branch_id,
      :new.name,
      :new.email,
      :new.phone,
      :new.address,
      :new.email,
      :new.phone,
      :new.address
    );
ELSE
  INSERT
  INTO D12B_A14.user_not_mulund@rslink VALUES
    (
      :new.id,
      :new.role_id,
      :new.branch_id,
      :new.name,
      :new.email,
      :new.phone,
      :new.address,
      :new.email,
      :new.phone,
      :new.address
    );
END IF; -- added the missing semicolon
END;
/

在看到警告后使用
显示错误
,或查询
用户错误
视图,查看实际的编译错误。