Using the new 6.0.1 version of the driver on Delphi XE2 Enterprise and Oracle Database Standard Edition One 11G Release 2 (11.2.0.2) we encountered a problem with TSQLStoredProc trying to execute a stored procedure with VarChar2 out parameter. The following exception is thrown on ExecProc:
Could not parse the GetProcedureParameters metadata command. Problem found near: :. Original query: GetProcedureParameters host:1521:service . user . GetTestValue .
With version 5.1.2 of the driver on the same Delphi XE2 Enterprise and Oracle Database Standard Edition One 11G Release 2 (11.2.0.2) we receive the correct 'Some test value' message.
The following sample code demonstrates the problem (paste it in button click event handler on a new form of new vcl forms application and fill the proper oracle login info):
Code: Select all
uses
DbxOdaDriverLoader, SqlExpr, DBXCommon, DriverOptions, DB;
Code: Select all
const
HostName = 'host';
Port = '1521';
ServiceName = 'service';
UserName = 'user';
Password = 'pass';
SFalse = 'False';
STrue = 'True';
var
con: TSQLConnection;
sp: TSQLStoredProc;
begin
con:= TSQLConnection.Create(nil);
try
con.DriverName:= DbxOdaDriverLoader.sDirectBuiltinDriverName;
con.VendorLib:= 'dbexpoda40.dll';
con.GetDriverFunc:= 'getSQLDriverORADirect';
con.LibraryName:= 'dbexpoda40.dll';
con.Params.Clear;
con.Params.Values[TDBXPropertyNames.DriverPackageLoader]:= TDbxOdaDriverLoader.ClassName;
con.Params.Values[TDBXPropertyNames.Database]:= Format('%s:%s:%s', [HostName, Port, ServiceName]);
con.Params.Values[TDBXPropertyNames.UserName]:= UserName;
con.Params.Values[TDBXPropertyNames.Password]:= Password;
con.Params.Values[SReconnect]:= SFalse;
con.Params.Values[SEnableBCD]:= SFalse;
con.Params.Values[SLongStrings]:= STrue;
con.Params.Values[SUseUnicode]:= STrue;
con.Params.Values[SUseUnicodeMemo]:= STrue;
con.Connected:= True;
try
sp:= TSQLStoredProc.Create(nil);
try
sp.SQLConnection:= con;
sp.StoredProcName:= 'GetTestValue';
sp.ExecProc;
ShowMessage(sp.Params[0].AsString);
finally
FreeAndNil(sp);
end;
finally
con.Connected:= False;
end;
finally
FreeAndNil(con);
end;
end;
To be able to run the example please create the following simple stored procedure:
Code: Select all
create procedure GetTestValue(AValue out VarChar2) is
begin
AValue:= 'Some test value';
end;