Maintaining TOracleObject after Query.Next

Sonique

Member²
With my current project I have a need to fetch TOracleObject instances from a query (relational table with object column) for each row, then re-use them later. The problem I have is that on TOracleQuery.Next, the internal OCIObject referred to by my current instance of TOracleObject is overwritten, so it now refers to data from a different row
frown.gif


As it is not an object table, I can't use TOracleObject.Reference and pin it later on ... is there any other way to use a TOracleObject reference after moving on to the next row in a result set? I'm fairly certain that OCI allows it ... and I'm hoping I don't have to add my own method to TOracleQuery to achieve what I need to do

confused.gif
 
You can create a new TOracleObject instance of the corresponding type, and use its Assign method to copy the data from the object instance you have retrieved from the result set.

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
You can create a new TOracleObject instance of the corresponding type, and use its Assign method to copy the data from the object instance you have retrieved from the result set.


You'll never believe that I tried that, and thought that it didn't work ... now that I've double checked I found a slight mistake in my loop to display the objects "later". Woops
redface.gif


Thanks a lot for pointing me in the right direction!
 
Back
Top