SQL * PLUS触发器尚未编译,但未显示任何错误

我正在尝试使用sqlplus创建序列并触发,并且所有内容均以bash脚本的形式编写。 我的代码如下

su -p oracle -c "$ORACLE_HOME/bin/sqlplus -l mydb/mypass@localhost:1521/xe << !
    create sequence SEQ_NAME start with 1000 maxvalue 9999;

    create or replace trigger TRG_NAME
    before insert on TABLE_NAME
    for each row
    begin
        select SEQ_NAME.nextval into :new.MY_ID from dual;
    end;
!
"

执行上述命令后,我希望收到一些类似的日志

Sequence created

Trigger compiled

但是仅显示日志Sequence created。结果,仅创建序列而未创建触发器。我知道通过检查 SQL Developer 工具

问题是当我使用 SQL Developer 工具并执行脚本

create sequence SEQ_NAME start with 1000 maxvalue 9999;

create or replace trigger TRG_NAME
before insert on TABLE_NAME
for each row
begin
select SEQ_NAME.nextval into :new.MY_ID from dual;
end;

然后一切正常!序列和触发器已创建!

对这个问题有任何想法吗?

shangcangcun 回答:SQL * PLUS触发器尚未编译,但未显示任何错误

尝试一下,请告诉我们。

a = ["a","b","c","d"]
b = [1,2,3,4]

a.zip(b) # => [["a",1],["b",2],["c",3],["d",4]]
本文链接:https://www.f2er.com/2810567.html

大家都在问