ORA-04079:无效的触发器规范Oracle

时间:2013-03-18 21:07:20

标签: sql oracle triggers

    ORA-04079: invalid trigger specification

那是我的问题和代码

    CREATE OR REPLACE TRIGGER czwarty 
    INSTEAD OF INSERT 
    ON zlozona FOR EACH ROW
    AS BEGIN
    INSERT INTO klienci(id, imie, nazwisko)
    VALUES (4, imie, :NEW.nazwisko);
    END;

怎么了?我做了几乎所有事情:(

1 个答案:

答案 0 :(得分:4)

AS之前不应该有BEGIN。如果您需要在实际代码中声明局部变量,则需要使用DECLARE而不是AS

CREATE OR REPLACE TRIGGER trigger_name
  INSTEAD OF INSERT ON view_name
  FOR EACH ROW
DECLARE
  local_variable_declarations_here
BEGIN
  code_here;
END;