oracle 创建了序列为啥创建trigger时提示 02289序列不存在错误?
用powerdesigner生成的SQL语句如下,实在找不出哪里有问题。但oracle里却提示找不到序列。createsequence"bank_account_id_s...
用powerdesigner生成的SQL语句如下,实在找不出哪里有问题。但oracle里却提示找不到序列。
create sequence "bank_account_id_sequence"
increment by 1
start with 1
/
create trigger "tib_bank_account" before insert
on "bank_account" for each row
declare
integrity_error exception;
errno integer;
errmsg char(200);
dummy integer;
found boolean;
begin
-- Column ""bank_account_id"" uses sequence bank_account_id_sequence
select bank_account_id_sequence.NEXTVAL INTO :new."bank_account_id" from dual;
-- Errors handling
exception
when integrity_error then
raise_application_error(errno, errmsg);
end;
/ 展开
create sequence "bank_account_id_sequence"
increment by 1
start with 1
/
create trigger "tib_bank_account" before insert
on "bank_account" for each row
declare
integrity_error exception;
errno integer;
errmsg char(200);
dummy integer;
found boolean;
begin
-- Column ""bank_account_id"" uses sequence bank_account_id_sequence
select bank_account_id_sequence.NEXTVAL INTO :new."bank_account_id" from dual;
-- Errors handling
exception
when integrity_error then
raise_application_error(errno, errmsg);
end;
/ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询