| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> a row-level operator for copying?
I've got two identical tables -- one has current data, and one
has historical data. I've got a nightly job which moves older
data from the current table to the history table. In the
code sample below, these tables are atest and atest_history).
Three questions:
Many TIA!
Mark
cursor getfinished
is
select a, seq, c
from atest
where c = 1;
begin
open getfinished;
loop
fetch getfinished
into atest_rec;
exit when getfinished%notfound;
dbms_output.PUT_LINE('v_atest = ' || atest_rec.a);
insert into atest_history
(a, seq, c)
values (atest_rec.a, atest_rec.seq, atest_rec.c);
delete from atest
where seq = atest_rec.seq;
end loop;
dbms_output.PUT_LINE('done,rowcount=' || getfinished%rowcount);
close getfinished;
![]() |
![]() |