Print Thread
Maintaining TOracleObject after Query.Next
#796 08/24/00 09:16 AM
Joined: Aug 2000
Posts: 21
Melbourne,VIC,Australia
S
Sonique Offline OP
Member
OP Offline
Member
S
Joined: Aug 2000
Posts: 21
Melbourne,VIC,Australia
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 [Linked Image]

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

[Linked Image]

Re: Maintaining TOracleObject after Query.Next
#797 08/24/00 04:57 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
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


Marco Kalter
Allround Automations
Re: Maintaining TOracleObject after Query.Next
#798 08/24/00 05:31 PM
Joined: Aug 2000
Posts: 21
Melbourne,VIC,Australia
S
Sonique Offline OP
Member
OP Offline
Member
S
Joined: Aug 2000
Posts: 21
Melbourne,VIC,Australia
[quote]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.

[/quote]

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 [Linked Image]

Thanks a lot for pointing me in the right direction!


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.047s Queries: 14 (0.017s) Memory: 2.5029 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-05-03 18:44:41 UTC
Valid HTML 5 and Valid CSS