Marco Erdmann
Member
I sent this to support, but did not receive an answer yet. In order to adress a wider audience, I repost that topic here:
We currently experience an ORA-22370 error in code that was working previously. We first found the problem when upgrading our Oracle client version to 11.2.0.2. The error is also visible if the database is 11.2.0.2, but here it gets weird. I have tested the following combinations (instant client against Enterprise Edition) now:
Client 11.2.0.1, DB 11.2.0.2 => Error
Client 11.2.0.2, DB 11.2.0.1 => Error
Client 11.2.0.2, DB 11.2.0.2 => Error
Client 11.2.0.1, DB 11.2.0.1 => No error
Client 10.2.0.4, DB 11.2.0.2 => No error
The last result is most astonishing. The problem seems to be located in the creation of a "table of sys.anydata" in the object. Please find a Delphi project attached, that demonstrates the problem. We are using Delphi XE Professional Update 1 and the latest set of DOA components from the registered users page (4.1.2.2).
Here is the script to create the objects:
And here is the Delphi command line project that creates the error:
Thanks in advance for any help you can provide. I am out of ideas how to "re-phrase" the affected code.
We currently experience an ORA-22370 error in code that was working previously. We first found the problem when upgrading our Oracle client version to 11.2.0.2. The error is also visible if the database is 11.2.0.2, but here it gets weird. I have tested the following combinations (instant client against Enterprise Edition) now:
Client 11.2.0.1, DB 11.2.0.2 => Error
Client 11.2.0.2, DB 11.2.0.1 => Error
Client 11.2.0.2, DB 11.2.0.2 => Error
Client 11.2.0.1, DB 11.2.0.1 => No error
Client 10.2.0.4, DB 11.2.0.2 => No error
The last result is most astonishing. The problem seems to be located in the creation of a "table of sys.anydata" in the object. Please find a Delphi project attached, that demonstrates the problem. We are using Delphi XE Professional Update 1 and the latest set of DOA components from the registered users page (4.1.2.2).
Here is the script to create the objects:
Code:
-- create user
create user appuser identified by appuser;
grant connect, resource to appuser;
-- as appuser
create or replace type inner_type is table of sys.anydata;
/
create or replace type outer_type as object
(
attr inner_type,
constructor function outer_type(self in out outer_type) return self as result
);
/
create or replace type body outer_type is
constructor function outer_type(self in out outer_type) return self as result is
begin
self.attr := inner_type();
return;
end;
end;
/
And here is the Delphi command line project that creates the error:
Code:
program dmo;
{$APPTYPE CONSOLE}
uses
SysUtils,
Oracle;
var
ASession: TOracleSession;
AQuery: TOracleQuery;
AObject: TOracleObject;
begin
try
ASession := TOracleSession.Create(nil);
try
ASession.LogonUsername := 'appuser';
ASession.LogonPassword := 'appuser';
ASession.LogonDatabase := 'db';
ASession.LogOn;
if ASession.Connected then
begin
AObject := TOracleObject.Create(ASession, '"APPUSER"."OUTER_TYPE"', '');
try
AQuery := TOracleQuery.Create(nil);
try
AQuery.Session := ASession;
AQuery.SQL.Append('begin');
AQuery.SQL.Append(' :function_result := "APPUSER"."OUTER_TYPE"();');
AQuery.SQL.Append('end;');
AQuery.DeclareVariable('function_result', otObject);
AQuery.SetComplexVariable('function_result', AObject);
AQuery.Execute;
finally
AQuery.Free;
end;
finally
AObject.Free;
end;
end;
ASession.LogOff;
finally
ASession.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
Thanks in advance for any help you can provide. I am out of ideas how to "re-phrase" the affected code.
Last edited: