create or replace procedure pro_DataCopyAndCheck is
ls_COD varchar2(50);
ls_STA VARCHAR2(1);
ls_LNG VARCHAR2(3);
ld_EMS DATE;
ls_OPR_EMS VARCHAR2(20);
ls_REV VARCHAR2(3);
ld_REV DATE;
ls_OPR_REV VARCHAR2(20);
ls_SIG_PRD VARCHAR2(1);
ls_FIL_LAME VARCHAR2(1);
ls_COD_LAME VARCHAR2(5);
cursor get70TableData is
select I94_COD_QCP,I94_STA_QCP,I94_LNG_QCP,D94_EMS_QCP,T94_OPR_EMS_QCP,
I94_REV_QCP,D94_REV_QCP,T94_OPR_REV_QCP,I27_SIG_PRD,
F94_FIL_LAME,I94_COD_LAME from TGED070_QCP_STANGING;
begin
open get70TableData;
fetch get70TableData into
ls_COD,ls_STA,ls_LNG,ld_EMS,ls_OPR_EMS,ls_REV,ld_REV,
ls_OPR_REV,ls_SIG_PRD,ls_FIL_LAME,ls_COD_LAME;
while get70TableData%found loop
insert into TGED070_QCP values
(ls_COD,ls_STA,ls_LNG,ld_EMS,ls_OPR_EMS,ls_REV,ld_REV,
ls_OPR_REV,ls_SIG_PRD,ls_FIL_LAME,ls_COD_LAME);
EXCEPTION
when others then
ls_COD := " ";
fetch get70TableData into
ls_COD,ls_STA,ls_LNG,ld_EMS,ls_OPR_EMS,ls_REV,ld_REV,
ls_OPR_REV,ls_SIG_PRD,ls_FIL_LAME,ls_COD_LAME;