DECLARE
tempid VARCHAR2(50);
nums numeric;
tempnums varchar2(50);
begin
nums:=1;
for tableInfo in (select FI_ID from FILEINFO) loop
if nums<10 then
tempnums:=CONCAT('00',nums);
else
if nums<100 then
tempnums:=CONCAT('0',nums);
else tempnums:=nums;
end if;
end if;
update FILEINFO set FI_REMARK=CONCAT('TGP-JT-',tempnums) WHERE FI_ID=tableInfo.FI_ID;
nums:=nums+1;
dbms_output.put_line(nums);
end loop;
end;