Hi
- 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).
- 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