I have written a procedure which will fetch data from one table (table A) and insert into another table (table B). Bu using cursor i have done this. I want to keep a flag into table A which will be updated after inserting the data into table B. So that, I can be sure which data has already been transferred to table B.
But I am not sure how I shall update the table A.
My procedure is like this:
DECLARE
var_sl number(20);
var_inout varchar2(100);
var_door varchar2(100);
var_lsts varchar2 (100);
CURSOR att_cur is select "SL","in_out","DoorNo","L_Status" from access5@ATTENDANCE;
BEGIN
OPEN att_cur;
loop
fetch att_cur into var_sl,var_inout,var_door,var_lsts;
insert into apscl_attendance(SL,ACCESS_FLAG,GATE_NO,L_STATUS)
values (var_sl,var_inout,var_door,var_lsts);
update access5@ATTENDANCE set "Uploaded"=1:
EXIT WHEN att_cur%NOTFOUND;
end loop;
CLOSE att_cur;
END;