TOraStoredProc + runtime parameters assignment

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
willianjhonnes
Posts: 9
Joined: Mon 28 Jul 2008 14:47
Location: Curitiba / Paraná / Brazil

TOraStoredProc + runtime parameters assignment

Post by willianjhonnes » Mon 28 Jul 2008 16:13

Hello all...

I'm trying to create some parameters in a runtime class into TOraStoredProc objects, but my procedure (in Delphi) retunrs an "Invalid property value" error.

This is the code of my procedure:

Code: Select all

procedure TOraDBConnection.CreateStoredProcParam(StoredProc: TOraStoredProc; PType: TParamType;
  PName, PValue: String);
var
  rParam: TParam;
begin
  //Create new parameters into TOraStoredProc objects
  rParam := TParam.Create(FParams, PType);
  rParam.Name := PName;
  rParam.Value := PValue;
  StoredProc.Params.AddParam(rParam);
end;
How can I make it works?

Thank you...

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

Post by Plash » Tue 29 Jul 2008 07:07

You should create a TOraParam instance instead of TParam. You can also use the CreateParam method of TOraStoredProc.Params. This method creates a parameter of the correct type and automatically adds it to the Params collection.

Post Reply