Stored Procedure Param Size issue with DescribeParams

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lam
Posts: 13
Joined: Wed 09 Mar 2016 15:42

Stored Procedure Param Size issue with DescribeParams

Post by lam » Fri 29 Apr 2016 20:22

I have an issue with the use of StoredProcs, running this code:

Code: Select all

function TForm7.CallStoredProc(param1: integer; param2: string): string;
var IBCStoredProc2: TIBCStoredProc;
begin
  IBCStoredProc1.Connection := IBCConnection1;
  IBCStoredProc1.Options.DescribeParams := true;
  IBCStoredProc1.StoredProcName := 'EXAMPLE_STORED_PROC';
  IBCStoredProc1.Prepare;
  IBCStoredProc1.Params[0].AsInteger := param1;
  IBCStoredProc1.Params[1].AsString := param2;

  IBCStoredProc1.Transaction.Active := True;
  IBCStoredProc1.ExecProc;
  IBCStoredProc1.Transaction.Commit;
  Result := IBCStoredProc1.Params[2].AsString;
end;
The 'EXAMPLE_STORED_PROC' is defined in my firebird DB and expecting 2 input parameters of type Integer. I need to be able to pass the 2nd parameter as String as shown in the code. The problem is that if I send first a string '1' and then, on a subsequent call with the same StoredProc Object I send '4321' the parameter is truncated to '4'.

Can someone tell me what's happening?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Stored Procedure Param Size issue with DescribeParams

Post by ViktorV » Fri 06 May 2016 07:58

Thank you for the information. We have reproduced the issue and investigation is in progress. We will inform you when we have any results.

Post Reply