十口文 2016-08-07 15:11 采纳率: 100%
浏览 2269
已采纳

用powerdesigner生成oracle的触发器,报触发器无效且未通过重新验证

我是用powerdesigner生成触发器的,头文件已经删除。查看具体错误信息时显示:
TRIGGER WEN.COMPOUNDUPDATETRIGGER_HRM_USER 编译错误

错误:PLS-00103: 出现符号 "/"在需要下列之一时:
function pragma
procedure subtype type
current cursor delete
exists prior before after instead
行:8
文本:NULL;

生成的触发器脚本如下:

CREATE OR REPLACE TRIGGER COMPOUNDDELETETRIGGER_HRM_DEPT
FOR DELETE ON HRM_DEPT COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDINSERTTRIGGER_HRM_DEPT
FOR INSERT ON HRM_DEPT COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDUPDATETRIGGER_HRM_DEPT
FOR UPDATE ON HRM_DEPT COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE TRIGGER TIB_HRM_DEPT BEFORE INSERT
ON HRM_DEPT FOR EACH ROW
DECLARE
    INTEGRITY_ERROR  EXCEPTION;
    ERRNO            INTEGER;
    ERRMSG           CHAR(200);
    DUMMY            INTEGER;
    FOUND            BOOLEAN;

BEGIN
    --  COLUMN "ID" USES SEQUENCE SEQUENCE_1
    SELECT SEQUENCE_1.NEXTVAL INTO :NEW.ID FROM DUAL;

--  ERRORS HANDLING
EXCEPTION
    WHEN INTEGRITY_ERROR THEN
       RAISE_APPLICATION_ERROR(ERRNO, ERRMSG);
END;
/


CREATE OR REPLACE TRIGGER COMPOUNDDELETETRIGGER_HRM_DOCU
FOR DELETE ON HRM_DOCUMENT COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDINSERTTRIGGER_HRM_DOCU
FOR INSERT ON HRM_DOCUMENT COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDUPDATETRIGGER_HRM_DOCU
FOR UPDATE ON HRM_DOCUMENT COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE TRIGGER TIB_HRM_DOCUMENT BEFORE INSERT
ON HRM_DOCUMENT FOR EACH ROW
DECLARE
    INTEGRITY_ERROR  EXCEPTION;
    ERRNO            INTEGER;
    ERRMSG           CHAR(200);
    DUMMY            INTEGER;
    FOUND            BOOLEAN;

BEGIN
    --  COLUMN "ID" USES SEQUENCE SEQUENCE_1
    SELECT SEQUENCE_1.NEXTVAL INTO :NEW.ID FROM DUAL;

--  ERRORS HANDLING
EXCEPTION
    WHEN INTEGRITY_ERROR THEN
       RAISE_APPLICATION_ERROR(ERRNO, ERRMSG);
END;
/


CREATE OR REPLACE TRIGGER COMPOUNDDELETETRIGGER_HRM_EMPL
FOR DELETE ON HRM_EMPLOYEE COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDINSERTTRIGGER_HRM_EMPL
FOR INSERT ON HRM_EMPLOYEE COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDUPDATETRIGGER_HRM_EMPL
FOR UPDATE ON HRM_EMPLOYEE COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE TRIGGER TIB_HRM_EMPLOYEE BEFORE INSERT
ON HRM_EMPLOYEE FOR EACH ROW
DECLARE
    INTEGRITY_ERROR  EXCEPTION;
    ERRNO            INTEGER;
    ERRMSG           CHAR(200);
    DUMMY            INTEGER;
    FOUND            BOOLEAN;

BEGIN
    --  COLUMN "ID" USES SEQUENCE SEQUENCE_1
    SELECT SEQUENCE_1.NEXTVAL INTO :NEW.ID FROM DUAL;

--  ERRORS HANDLING
EXCEPTION
    WHEN INTEGRITY_ERROR THEN
       RAISE_APPLICATION_ERROR(ERRNO, ERRMSG);
END;
/


CREATE OR REPLACE TRIGGER COMPOUNDDELETETRIGGER_HRM_JOB
FOR DELETE ON HRM_JOB COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDINSERTTRIGGER_HRM_JOB
FOR INSERT ON HRM_JOB COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDUPDATETRIGGER_HRM_JOB
FOR UPDATE ON HRM_JOB COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE TRIGGER TIB_HRM_JOB BEFORE INSERT
ON HRM_JOB FOR EACH ROW
DECLARE
    INTEGRITY_ERROR  EXCEPTION;
    ERRNO            INTEGER;
    ERRMSG           CHAR(200);
    DUMMY            INTEGER;
    FOUND            BOOLEAN;

BEGIN
    --  COLUMN "ID" USES SEQUENCE SEQUENCE_1
    SELECT SEQUENCE_1.NEXTVAL INTO :NEW.ID FROM DUAL;

--  ERRORS HANDLING
EXCEPTION
    WHEN INTEGRITY_ERROR THEN
       RAISE_APPLICATION_ERROR(ERRNO, ERRMSG);
END;
/


CREATE OR REPLACE TRIGGER COMPOUNDDELETETRIGGER_HRM_NOTI
FOR DELETE ON HRM_NOTICE COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDINSERTTRIGGER_HRM_NOTI
FOR INSERT ON HRM_NOTICE COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE OR REPLACE TRIGGER COMPOUNDUPDATETRIGGER_HRM_NOTI
FOR UPDATE ON HRM_NOTICE COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


CREATE TRIGGER TIB_HRM_NOTICE BEFORE INSERT
ON HRM_NOTICE FOR EACH ROW
DECLARE
    INTEGRITY_ERROR  EXCEPTION;
    ERRNO            INTEGER;
    ERRMSG           CHAR(200);
    DUMMY            INTEGER;
    FOUND            BOOLEAN;

BEGIN
    --  COLUMN "ID" USES SEQUENCE SEQUENCE_1
    SELECT SEQUENCE_1.NEXTVAL INTO :NEW.ID FROM DUAL;

--  ERRORS HANDLING
EXCEPTION
    WHEN INTEGRITY_ERROR THEN
       RAISE_APPLICATION_ERROR(ERRNO, ERRMSG);
END;
/


CREATE OR REPLACE TRIGGER COMPOUNDDELETETRIGGER_HRM_USER
FOR DELETE ON HRM_USER COMPOUND TRIGGER
// DECLARATION
// BODY
  BEFORE STATEMENT IS
  BEGIN
     NULL;
  END BEFORE STATEMENT;

  BEFORE EACH ROW IS
  BEGIN
     NULL;
  END BEFORE EACH ROW;

  AFTER EACH ROW IS
  BEGIN
     NULL;
  END AFTER EACH ROW;

  AFTER STATEMENT IS
  BEGIN
     NULL;
  END AFTER STATEMENT;

END
/


/

  • 写回答

1条回答 默认 最新

  • 十口文 2016-08-07 15:41
    关注

    我已经解决,创建时勾多了几个选项

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧,别用大模型回答,大模型的答案没啥用
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。