How to get TOraRef from TOraObject?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
NightProwler
Posts: 9
Joined: Thu 29 Jun 2006 14:04

How to get TOraRef from TOraObject?

Post by NightProwler » Mon 10 Jul 2006 13:05

There is TOraObject.
How to get Ref on this object (like OCIObjectGetObjectRef)?

I try

Code: Select all

r: TOraRef;
o: TOraObject;
.......
o := sql1.ParamByName('Par1').AsObject;
r := TOraRef.Create(o.ObjectType);
r.Assign(o);
But in this case

Code: Select all

r.AsHex
return empty string.
Thanks.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 11 Jul 2006 09:03

ODAC doesn't have such feature. You should use REF function in SQL to obtain object reference.

NightProwler
Posts: 9
Joined: Thu 29 Jun 2006 14:04

Post by NightProwler » Tue 25 Jul 2006 14:23

Perhaps, OCIObjectGetObjectRef has wrong declaration in OraCall?

In OCI ori.h

Code: Select all

sword OCIObjectGetObjectRef(    OCIEnv *env, OCIError *err, dvoid *object, OCIRef *object_ref    );
In OraCall

Code: Select all

  _OCIObjectGetObjectRef = function (... var object_ref: pOCIRef) ...
It seems that pOCIRef is equivalent to OCIRef*, then var is unnecessary?

I tried to call OCIObjectGetObjectRef(.... r) where

Code: Select all

var r: pOCIRef
It is not working. When I call OCIObjectGetObjectRef(.... Pointer(r^)), it's OK.

Say, OCIObjectGetObjectRef is used in TOraObject and it's work... I don't understand why.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 26 Jul 2006 09:21

Thank you for assistance. We have corrected the declaration of OCIObjectGetObjectRef function. This correction will be included in the next build of ODAC.

Post Reply