原来写了一个cursor,想把可用的卡号(也就是能够读取的数据)都放到另外一个表中保存起来,这样只是导出这些数据就可以了
但是,发现这样选出来的卡,再次用select keyno,fingerpos,fpimagelen from tpimage时还是出现corrupt block的情况
现在讲写的程序贴在下面:
create or replace procedure getGoodKeyNo is
cursor c_BadKeyNo is select keyno,fingerpos from tpimage;
c_BadKeyNoRecc_BadKeyNo%rowtype;
vKeyNo varchar2(20);
vFingerPos number;
vFpImageLen number;
myException Exception;
begin
delete from badkeyno;
if not c_BadKeyNo%isopen then
open c_BadKeyNo;
end if;
loop
Fetch c_BadKeyNo into c_BadKeyNoRec;
exit when c_BadKeyNo%notfound;
begin
select keyno,fingerpos,fpimagelen into vKeyNo,vFingerPos,vFpImageLen
from tpimage
where keyno=c_BadKeyNoRec.KeyNo
and fingerpos=c_BadKeyNoRec.FingerPos;
insert into badkeyno values(c_BadKeyNoRec.KeyNo,c_BadKeyNoRec.FingerPos);
Exception
when others then null;
end;
end loop;
commit;
end getGoodKeyNo;
|