Get Cursor from Package from DLL - assertion error

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
merdock
Posts: 2
Joined: Thu 28 Feb 2008 15:41

Get Cursor from Package from DLL - assertion error

Post by merdock » Tue 04 Mar 2008 15:33

I need to put all DB component specific code into dll and work with it.

When i run code approximately noted below i get an assertion error
TESTCASE:

DLL

Code: Select all

Library
...
function CreateQuery:TDataSet;stdcall;
begin
  result:=TOraQuery.Create(OraSession1);
end;  
function GetSQL(var oraquery:TDataSet):TStrings;stdcall;
begin
  result:=TOraQuery(obj).SQL;
end;
Function GetParams(var oraquery:TDataSet):TStrings;stdcall;
begin
  result:=TOraQuery(obj).Params;
end;

PRG

Code: Select all

....//load init proc and etc
proc test;
q:TDataSet;
s:TStrings;
p:TParams;
begin
  q:=CreateQuery;
  s:=GetSQL(q);
  s.clear;
  s.add('begin mypkg.myproc(:a); end;');
  p:=GetParams(q);
  p[0].ParamType:=ptOutput;
  p[0].DataType:=ftCursor;
  q.open;  //raise assertion error in oraclasses.pas in 5730
end;
ODAC 6.25.2.14 Trial Oracle 10G

Thnx.

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

Post by Plash » Thu 06 Mar 2008 08:07

You cannot use DataType property of TParam class to set data type of TOraQuery's parameters.
You should use DataType property of TOraParam class. For example, you can add the following procedure to your DLL:

Code: Select all

procedure SetParamDataType(Param: TParam; DataType: TFieldType); stdcall; 
begin
  TOraParam(Param).DataType := DataType;
end;

Post Reply