Page 1 of 1

TOraStoredProc + runtime parameters assignment

Posted: Mon 28 Jul 2008 16:13
by willianjhonnes
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...

Posted: Tue 29 Jul 2008 07:07
by Plash
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.