Oracle Package Wizard produces wrong data types

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Roy Fraties
Posts: 4
Joined: Fri 03 Apr 2009 18:23

Oracle Package Wizard produces wrong data types

Post by Roy Fraties » Thu 01 Oct 2009 23:47

This is ODAC version 6.5.0.12 running against Delphi 5 and an Oracle 11 database.

Here is the Oracle description of the package, for one method only

PROCEDURE GETPRODVERSION
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
PROD_ID NUMBER(38) IN
VER_NAME VARCHAR2 IN
VER_ID NUMBER(38) IN/OUT

Here is what the package wizard gives me

procedure TPAC_DFE.GETPRODVERSION(const PROD_ID: string; const VER_NAME: double; var VER_ID: string);
var
PROD_ID_Param, VER_NAME_Param, VER_ID_Param: TOraParam;
begin
BeginExecPLSQL;
try
PROD_ID_Param := AddParam('PROD_ID', ftUnknown, ptInput);
PROD_ID_Param.AsString := PROD_ID;
VER_NAME_Param := AddParam('VER_NAME', ftFloat, ptInput);
VER_NAME_Param.AsFloat := VER_NAME;
VER_ID_Param := AddParam('VER_ID', ftString, ptInputOutput);
VER_ID_Param.Size := 22;
VER_ID_Param.AsString := VER_ID;
ExecProc('GETPRODVERSION');
VER_ID := VER_ID_Param.AsString;
finally
EndExecPLSQL;
end;
end;

You can see that VER_NAME is incorrectly cast as a double, and VER_ID is incorrectly cast as a string.

Perhaps the combination of IN and IN/OUT parameters has caused the problem.

Is this a known bug? Has it been fixed?

The work-around is to use variants. However, variants are not as easy to use. Yes, I can manually alter the generated code, but then the next time I refresh the generated code, I would lose all manual edits.

Thank you,

Post Reply