TRIGGER AUTO_NUM_GEN已编译警告:执行完成并显示警告 [英] TRIGGER AUTO_NUM_GEN compiled Warning: execution completed with warning
本文介绍了TRIGGER AUTO_NUM_GEN已编译警告:执行完成并显示警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在oracle sql developer中使用oracle 11g express作为数据库运行以下语句.当我尝试创建触发器时,我只会遇到问题.我收到消息-
I run the following statements in oracle sql developer using oracle 11g express as my database. I only run into problems when i try to create the trigger. I get the message -
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; /
我的错误是什么,为什么它不起作用?
What is my mistake and why won't it work ?
我运行了诊断查询-
show errors trigger myschema.auto_num_gen;
然后看到-
PLS-00103: Encountered the symbol "/" The symbol "/" was ignored
在侧面, 当通过Java运行相同的代码时,我也会收到错误-
On the side, When the same code is run through java i also get the error -
java.sql.SQLSyntaxErrorException: ORA-04098: trigger
'MYTABLE.MYSCHEMA.AUTO_NUM_GEN ' is invalid and failed re-validation
推荐答案
最后的斜杠/是您的敌人!删除它,代码即可工作!
The slash / at the end is your enemy ! Remove it and the code works !
这篇关于TRIGGER AUTO_NUM_GEN已编译警告:执行完成并显示警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文