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

Home -> Community -> Usenet -> c.d.o.server -> Cursor reuse / reset

Cursor reuse / reset

From: Sam Jordan <sjo_at_spin.ch>
Date: Mon, 03 May 1999 08:19:00 +0000
Message-ID: <372D5BF4.C46F3B92@spin.ch>


Hi

  1. Has anyone managed to reuse a cursor in the following way: In a stored procedure a cursor is opened using 'open mycur for select xxx', afterwards this cursor variable is assigned to a second variable. Using the second variable all rows are fetched and history information is generated and inserted into another table. Now the first cursor variable is returned and the host application itself fetches the rows again to do something else with them. I tried it and the host application throws a 'fetch out of sequence' error, which seems to indicate that the first fetching actually incremented the cursor itself, not only the cursor reference (which basically contradicts to my understanding of using references/pointers).
  2. Does anyone know how to reset a cursor, so that the above problem doesn't appear yet?

Right now I'm simply opening the cursor twice to bypass the problems, but probably this isn't really efficient. Before people suggest to generate the history data in the host application: I really want to do this in the stored procedure.

bye
--
Sam Jordan Received on Mon May 03 1999 - 03:19:00 CDT

Original text of this message

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