带有编译错误的Oracle触发器创建,ORA-02289:序列不存在 [英] Oracle Trigger creation with compilation errors, ORA-02289: sequence does not exist

查看:1094
本文介绍了带有编译错误的Oracle触发器创建,ORA-02289:序列不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用PowerDesigner生成SQL并在Oracle中运行它时,会引发错误

When I generate the SQL using PowerDesigner and run it in Oracle, it throws the error

警告:带有编译错误的触发器创建

Warning:Trigger creation with compilation errors

create trigger "tib_material_classify" before insert
on "material_classify" for each row
declare
    integrity_error  exception;
    errno            integer;
    errmsg           char(200);
    dummy            integer;
    found            boolean;

begin
    --  column ""id"" uses sequence material_classify_seq;
    select material_classify_seq.nextval into :new."id" from dual;

--  errors handling
exception
    when integrity_error then
       raise_application_error(errno, errmsg);
end;

当我在Oracle中发布show errors时,它表示以下内容:

When I issue show errors in Oracle, it says the following:

10/5 PL/SQL:忽略了SQL语句 10/12 PL/SQL:ORA-02289:序列不存在

10/5 PL/SQL: SQL Statement ignored 10/12 PL/SQL: ORA-02289: sequence does not exist

我在做什么错了?

推荐答案

在创建触发器之前,您需要创建序列 Create sequence material_classify_seq start with 1;创建触发器后

Before create trigger you need create sequnce Create sequence material_classify_seq start with 1; after create trigger

这篇关于带有编译错误的Oracle触发器创建,ORA-02289:序列不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆