在SQLplus上执行脚本,脚本很简单,为什只执行了前两行,后面就不执行了?急啊!
脚本文件内容就是8行:
CREATE SEQUENCE "DBTU"."SEQ_LOGHIS" MINVALUE 1 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 1 CYCLE;
CREATE OR REPLACE TRIGGER "DBTU"."TRG_LOGHIS" before insert on LOGHIS for each row begin select SEQ_LOGHIS.nextval into :new.ID from dual; end;
CREATE SEQUENCE "DBTU"."SEQ_MSGOL" MINVALUE 1 MAXVALUE 9999999999 INCREMENT BY 1 START WITH 1 CYCLE;
CREATE OR REPLACE TRIGGER "DBTU"."TRG_MSGOL" before insert on MSGOL for each row begin select SEQ_MSGOL.nextval into :new.MSGID from dual; end;
执行:
SQL> @schema.sql;
Sequence created.
8
// 到这就不继续了,应该是执行到第8行了吧,但是查看只创建了SEQ_LOGHIS 和 TRG_LOGHIS,没创建SEQ_MSGOL和TRG_MSGOL,为什么啊?
SQL> select sequence_name from user_sequences;
SEQUENCE_NAME
------------------------------
SEQ_LOGHIS
SQL>
SQL> select trigger_name from user_triggers;
TRIGGER_NAME
------------------------------
TRG_LOGHIS
SQL>
------解决方案--------------------第一个end;后面加斜线