I've constructed a class to represent a query object that's simliar to a ColdFusion query object. The problem is that one of my attributes is the recordCount. After setting this attribute (I use a while(ora_fetch($cursor == 1)) loop & a counter), I receive this error when trying to display the query object's result cursor:
Ora_Fetch failed (ORA-01002: fetch out of sequence -- while processing OCI function OFETCH/OFEN)
If I remove the call to the recordCount method, everything is fine.
I've tried reset($cursor). I receive no error on the reset(), but I receive the same ORA-01002 message.
I'm even passing the result cursor into the method instead of the method updating the attribute directly, thinking that would give the result cursor & recordcount cursor their own space in memory.
The only solution I've found thus far is actually parsing & exec'ing the SQL again to get another good cursor. But that seems to me to be actually running the query again (bad).
Any suggestions on resetting the cursor or a better way to get the recordCount, pls respond.