我试图创建一个简单的触发器,但出现了以下错误。我在互联网上搜索,但无法找到解决方案。你能帮我解决这个问题吗?Oracle SP2-0552:绑定变量“NEW”未声明
create trigger ProcessTigger before insert on T039
for each row
declare consecutivo int; idconsecutivo int; maxconsecutivo int;
begin
select t326c004 into consecutivo from T326 where t326c003 = 'T039' and t326c002 = :new.t039c004;
if consecutivo is not null
then
consecutivo :=consecutivo+1;
select t326c001 into idconsecutivo from T326 where t326c002 = :new.t039c004 and t326c003=T039;
update T326 set t326c004 = consecutivo where t326c001=idconsecutivo and t326c003=T039;
else
select max(t039c003) into maxconsecutivo from T039 where t071c002=:new.t039c004;
if maxconsecutivo is not null
then consecutivo := maxconsecutivo+1;
else consecutivo:=1;
end if;
insert into T326
(t326c002,t326c003,t326c004)values(:new.t039c004,'T039',consecutivo);
end if;
end;
错误:
SP2-0552:绑定变量 “NEW” 未声明。
那么,这是什么? ORA-04071,触发器缺少BEFORE/AFTER/INSTEAD OF子句?或者SP2-0552,绑定变量“NEW”没有声明? Oracle一次抛出一个错误,所以它不能**都是。 – mathguy
抱歉,我在问题的标题中错了。问题是或SP2-0552,绑定变量“新”没有声明 –
使用您的文章下方的小'编辑'链接进行编辑 - 您可以更改标题以符合您的问题。 – mathguy