create or replace procedure Create_Barcodes as
--用于生成条码值bar varchar(10);
i number(10);
begin
i:=1;
while i<10000 loop
bar:=to_char(i,'9999999999');--报错:“ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小”
bar:=TRANSLATE(bar , ' ' , '0');
insert into sys_barcode
(barcode, is_used)
values
(bar, 0);
i :=i+1;
end loop; commit;
end;
--用于生成条码值bar varchar(10);
i number(10);
begin
i:=1;
while i<10000 loop
bar:=to_char(i,'9999999999');--报错:“ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小”
bar:=TRANSLATE(bar , ' ' , '0');
insert into sys_barcode
(barcode, is_used)
values
(bar, 0);
i :=i+1;
end loop; commit;
end;
Action Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.