Fetch out of sequence in cursor
- From: "PAUL MADDSION" <60_pm@xxxxxxxxxxxxxxxx>
- Date: Mon, 28 Aug 2006 10:26:47 GMT
Hi,
I have a cursor which loops through a table and does some processing.
Towards the end of the loop I update another table and I want to COMMIT each
record in turn. I'm getting a fetch out of sequence message when i try to
run this and believe it is because I'm trying to commit within the cursor
loop. Any suggestions on how I can get round this would be greatly
appreciated. An outline of what I'm trying to do is shown below.
Thanks in advance.
PROCEDURE update_rec
IS
--
CURSOR c_record
IS
SELECT
FROM
WHERE;
--
processed_rec c_record%ROWTYPE;
--
BEGIN
FOR r_record IN c_record LOOP
--
BEGIN
--
process record
--
write to another table
--
-- if I get this far I want to commit individual records
COMMIT;
EXCEPTION
ROLLBACK;
handle any exceptions raised in the loop
END LOOP;
--
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
handle any exceptions outside the loop
END;
.
- Follow-Ups:
- Re: Fetch out of sequence in cursor
- From: oradbamohan@xxxxxxxxx
- Re: Fetch out of sequence in cursor
- From: DA Morgan
- Re: Fetch out of sequence in cursor
- From: Andy Hassall
- Re: Fetch out of sequence in cursor
- Prev by Date: Re: ODBC-error 'ORA-12535: TNS:operation timed out' when trying to connect to Oracle 9.2.0
- Next by Date: sum with null value
- Previous by thread: Slow response of Oracle forms
- Next by thread: Re: Fetch out of sequence in cursor
- Index(es):
Relevant Pages
|