如下所示:很简单的过程,但是总是报错。
create or replace procedure update_Ar_Info_Barcode
as
bar nvarchar2(15);
id nvarchar2(36);
begin
--for V in (select v.* from SYS_V v where v.t_id='b265fd74-294d-49a6-b656-46fac5af08e4')--存放位置
--找到所有没有条码的档案
for id in (select t.ar_id from Ar_Info t where t.ar_barcode is null or length(ar_barcode)<8 order by t.dply_no)
loop
--获取一个条码
select min(barcode) into bar from SYS_BARCODE where is_used=0; --更新相关的档案数据
update Ar_Info
set Ar_Info.Ar_Barcode=bar
where Ar_Info.ar_id=id;--这一行报错(Error: PLS-00382: 表达式类型错误)这是第二次遇到这个问题了。
--将已用条码置为已用
update SYS_BARCODE set is_used=1 where BARCODE=bar;
commit;
end loop;end;
create or replace procedure update_Ar_Info_Barcode
as
bar nvarchar2(15);
id nvarchar2(36);
begin
--for V in (select v.* from SYS_V v where v.t_id='b265fd74-294d-49a6-b656-46fac5af08e4')--存放位置
--找到所有没有条码的档案
for id in (select t.ar_id from Ar_Info t where t.ar_barcode is null or length(ar_barcode)<8 order by t.dply_no)
loop
--获取一个条码
select min(barcode) into bar from SYS_BARCODE where is_used=0; --更新相关的档案数据
update Ar_Info
set Ar_Info.Ar_Barcode=bar
where Ar_Info.ar_id=id;--这一行报错(Error: PLS-00382: 表达式类型错误)这是第二次遇到这个问题了。
--将已用条码置为已用
update SYS_BARCODE set is_used=1 where BARCODE=bar;
commit;
end loop;end;
Compilation errors for PROCEDURE EIMS.UPDATE_AR_INFO_BARCODEError: PLS-00382: 表达式类型错误
Line: 16
Text: where Ar_Info.ar_id=ArID;--报错