Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Fetch out of sequence in cursor

Re: Fetch out of sequence in cursor

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 29 Aug 2006 11:42:43 -0700
Message-ID: <1156876963.365444@bubbleator.drizzle.com>


PAUL MADDSION wrote:
> 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

Unless you have a version prior to 9i dump the cursor loop and use BULK COLLECT and FORALL. No loops. and put your COMMIT as the last item before the exception handler. Commits embedded in loops are a very bad practice and the specific cause your your current pain.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Tue Aug 29 2006 - 13:42:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US