I have a problem regarding PL/SQL. I want to know how to move backwards while scanning a cursor:
The prototype of my procedure is as follows:
In the if statement above, I want to fetch previous record and update some field of that record. But I dont seem to find any syntax for that. Actually, I am looking for something like
method of Visual Basic.
Thanks in anticipation.
The prototype of my procedure is as follows:
Code:
create or replace procedure xxx is
cursor c1 is select thmaster.rowid, thmaster.* from thmaster;
num_recs number;
prev_txn number;
curr_txn number;
begin
prev_txn:=0;
for r1 in c1
loop
curr_txn:=r1.txncntr;
if curr_txn<>prev_txn+1 then
-- [B]Here I want to fetch previous record and update some field of that record.[/B]
commit;
end if;
--
prev_txn:=curr_txn;
end loop;
end;
Code:
recordset.moveprevious
Thanks in anticipation.
Comment