TRIGGER AUTO_NUM_GEN compiled Warning: execution completed with warning

我们两清 提交于 2019-12-23 04:48:35

问题


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 

The 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 ?

I ran the diagnostic query -

show errors trigger myschema.auto_num_gen;

And saw -

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

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

回答1:


The slash / at the end is your enemy ! Remove it and the code works !



来源:https://stackoverflow.com/questions/12192124/trigger-auto-num-gen-compiled-warning-execution-completed-with-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!