Print Thread
TOracleObject.Assign and Collections
#843 09/04/00 09:26 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
A puzzling problem with Collections. I can quite happily create a new TOracleObject then copy an existing one using the Assign method. If I do the same for a collection type, it seems that the element data does not get copied. ie:

Obj1 := Query1.ObjField(0);
Obj2 := TOracleObject.Create(Session,'my_type','');
Obj2.Assign(Obj1);
// Obj1.ElementCount returns 3
// Obj2.ElementCount returns 2

Is this an Oracle problem (tested against 8.1.6) or is it a DOA problem? There's nothing obvious in the OCI documentation to indicate that anything more than OCIObjectCopy is required ....

Thanks,

Paul

Re: TOracleObject.Assign and Collections
#844 09/07/00 12:05 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
This indeed doesn't seem to work as expected. No errors or warnings are returned, so it does seem like a Net8 restriction or bug. I can't find any reference to limitations for collection objects though.


------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: TOracleObject.Assign and Collections
#845 09/27/00 01:54 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
Having resolved this apparent OCI bug (by way of manually copying all collection elements after calling TOracleObject.Assign), I've run into a stumbling block. If I have a table collection with an element type of BFile, I can not copy the element if it is not null (SetElement will not write BFILE elements of course).

This is not an urgent issue, and I know SetElement should not be changed to allow BFILE's to be written in to an element, but it does increase the urgency of resolving the original problem.

My initial suggestion (unless the reason for the failure of OCIObjectcopy can be determined) would be to modify the Assign method so that it copies the elements for collections. BFILE elements could then also be copied, and SetElement can stay how it is ...


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.031s Queries: 13 (0.010s) Memory: 2.5053 MB (Peak: 3.0427 MB) Data Comp: Off Server Time: 2024-05-17 11:01:38 UTC
Valid HTML 5 and Valid CSS