Page 1 of 1

ZStoredProc bug?

Posted: 27.11.2008, 09:12
by jk
Zeos 6.6.4 + MSDE 2005 + Delphi7

i have test stored proc sample:

Code: Select all

create procedure Z_TEST @ID INTEGER, @RES INTEGER OUTPUT
as
  SET NOCOUNT ON

  SELECT @RES = @ID
than i try to use it:

Code: Select all

  with ZStoredProc1 do
  begin
    ZStoredProc1.ParamCheck := false;
    StoredProcName := 'Z_TEST';
    Params.CreateParam(ftInteger, '@RETURN_VALUE', ptResult);
    Params.CreateParam(ftString, '@ID', ptInput);
    Params.CreateParam(ftInteger, '@RES', ptOutput);
    ParamByName('@ID').AsInteger := 100;
    ExecProc; // here all ok
    res := ParamByName('@RES').AsInteger;

    ParamByName('@ID').AsInteger := 200;
    ExecProc; // here exception
    res := ParamByName('@RES').AsInteger;
  end;
and at second call ExecProc i have an exception: "General SQL Server error: Check messages from the SQL Server.
Procedure or function 'Z_TEST' expects parameter '@RES', which was not supplied."

Posted: 27.11.2008, 15:04
by jk
the same problem i reproduced using firebird 2.0
but instead of sql error i've got access violation :(

Posted: 28.11.2008, 10:18
by jk
i think i fixed this problem, if anyone interested patch here:
http://jk.at.tut.by/zeos_6.6.4.patch.zip

but may be i broke something else :blink2: