Bug in TOracleObject.Create for Collections

Sonique

Member²
Hi there,

I've just made a patch to Oracle.pas (v3.3.1) to fix a problem I encountered - you may wish to include it in future releases if it hasn't already been fixed in 3.4.

The problem occurred when trying to create a new TOracleObject for a collection type, as OCI_TYPECODE_OBJECT was specified in the call to OCIObjectNew. I copied some code from TOracleQuery and changed this call as follows:

constructor TOracleObject.Create(ASession: TOracleSession;
const ATypeName: string;
const ATable: string);
var TableOwner, TableName: string;
Dot: Integer;
ObjectTypeCode: OCITypeCode;

function TDOToTypeCode(ATDO: OCIType): OCITypeCode;
{... copied from TOracleQuery and modified so it would compile here ...}
end;
begin
{...}
ObjectTypeCode := TDOToTypeCode(TDO);
OCICall(OCIObjectNew(Session.envhp, errhp, Session.svchp,
ObjectTypeCode,//OCI_TYPECODE_OBJECT,
TDO, Table, OCI_DURATION_SESSION,
Table = nil, Instance));
{...}
end;

Best Regards,

Paul Ward
 
This was not yet fixed in 3.4. I tested this, and creating a collection object instance on Net8 8.1 resulted in an exception. I tried your solution, and this fixed the problem. We will do some more tests and, if all goes well, include this fix in the 3.4.2 patch release that should be available next Monday.

Thanks for reporting this.

------------------
Marco Kalter
Allround Automations
 
Back
Top