TRIGGER AUTO_NUM_GEN编译警告:执行完成并发出警告

时间:2012-08-30 07:42:05

标签: java oracle11g oracle-sqldeveloper

我在oracle sql developer中使用oracle 11g express作为我的数据库运行以下语句。我尝试创建触发器时只会遇到问题。我收到了消息 -

TRIGGER AUTO_NUM_GEN compiled
Warning: execution completed with warning 

SQL-

CREATE TABLE myschema.mytable (mynums NUMBER PRIMARY KEY);
CREATE SEQUENCE myschema.seq_of_nums MINVALUE 1 
START WITH 1 INCREMENT BY 1 CACHE 10; 
CREATE OR REPLACE TRIGGER myschema.auto_num_gen 
BEFORE INSERT ON myschema.mytable FOR EACH ROW 
BEGIN SELECT seq_of_nums.nextval INTO :new.mynums FROM DUAL; end; /

我的错误是什么?为什么它不起作用?

我运行了诊断查询 -

show errors trigger myschema.auto_num_gen;

并看到 -

PLS-00103: Encountered the symbol "/" The symbol "/" was ignored

在旁边, 当通过java运行相同的代码时,我也会收到错误 -

java.sql.SQLSyntaxErrorException: ORA-04098: trigger 
'MYTABLE.MYSCHEMA.AUTO_NUM_GEN ' is invalid and failed re-validation

1 个答案:

答案 0 :(得分:0)

斜线/最后是你的敌人!删除它,代码可以工作!