当我想在Toad中触发到我的桌子时,我收到了错误。
这样的代码:
create table SEIAPPS_MODEL(MODEL_NO NUMBER PRIMARY KEY, MODEL_NAME VARCHAR(100))
create sequence SEIAPPS_MODEL_SEQ
start with 1
increment by 1
CREATE OR REPLACE TRIGGER TR_SEIAPPS_MODEL
BEFORE INSERT
ON SEIAPPS_MODEL
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT SEIAPPS_MODEL_SEQ.nextval INTO :NEW.MODEL_NO FROM dual;
END;
我得到的错误是:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
;
我错过了什么?
答案 0 :(得分:1)
create table SEIAPPS_MODEL(MODEL_NO NUMBER PRIMARY KEY, MODEL_NAME VARCHAR(100)) ;
-- ^^^^
create sequence SEIAPPS_MODEL_SEQ
start with 1
increment by 1
;
-- ^^^^
CREATE OR REPLACE TRIGGER TR_SEIAPPS_MODEL
BEFORE INSERT
ON SEIAPPS_MODEL
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT SEIAPPS_MODEL_SEQ.nextval INTO :NEW.MODEL_NO FROM dual;
END;
/
-- ^^^^
答案 1 :(得分:0)
您的查询没有语法错误。我不确定你为什么会收到错误。
我逐一执行了这些陈述,我能够执行所有三个成功的......