Page 1 of 1

Firebird stored procedure returning void dataset raise exception

Posted: 30.08.2022, 11:23
by abk964
With Firebird (3 and 2.5) stored procedure returning void dataset raise exception 'Row buffer is not assigned' at

Code: Select all

function TZRowAccessor.IsNull(ColumnIndex: Integer): Boolean;
Call stack:

Code: Select all

TZRowAccessor.IsNull(0)
TZAbstractCachedResultSet.IsNull(0)
TZAbstractPreparedStatement.IsNull(1)
TZAbstractCallableStatement.IsNull(1)
TZAbstractRODataset.RetrieveParamValues
TZAbstractRODataset.InternalOpen
TZStoredProc.InternalOpen
ZFBSPVoidTest
Can't find any solution. Reconnect helps only once.

Example project (Delphi 7) attached.

Procedure DDL:

Code: Select all

SET TERM ^ ;

CREATE OR ALTER PROCEDURE VOID_TEST_PROC ( inparam integer)
returns ( outparam integer)
as
begin
  if (inparam = 0 ) then exit;
  outparam = inparam;
  suspend;
  outparam = inparam + 1;
  suspend;
end^

SET TERM ; ^

Re: Firebird stored procedure returning void dataset raise exception

Posted: 30.08.2022, 16:10
by abk964
One more.
Third execution of selectable proceture raise exception 'Cursor is already open; GDS Code: 335544841;...".
To reproduce change ExecButtonClick to:

Code: Select all

  
procedure TForm1.ExecButtonClick(Sender: TObject);
var i: integer;
begin
  with ZStoredProc1 do begin
    Params[0].AsInteger := 1;
    Open;
    i := 0;
    while not Eof do begin OutputDebugString(PChar(IntToStr(Fields[0].AsInteger))); Inc(i); Next; end;
    SpinEdit1.Value := Fields[0].AsInteger;
    Close;
  end;
end;

And make 3 clicks.

Re: Firebird stored procedure returning void dataset raise exception

Posted: 31.08.2022, 14:10
by Fr0sT
Hi,
are you using fresh Zeos from SVN/GH? Is your issue fixed following this report viewtopic.php?f=50&t=167308 ?

Re: Firebird stored procedure returning void dataset raise exception

Posted: 31.08.2022, 15:14
by abk964
Hi.

Thanks. Have updated to r7867.
Both problems are not solved.

BTW. Isn't right time format in log 'hh:nn:ss"? "mm" - is month.

Code: Select all

function TZLoggingFormatter.Format(LoggingEvent: TZLoggingEvent): SQLString;
...
    SQLWriter.AddDateTime(LoggingEvent.Timestamp, 'yyyy-mm-dd hh:mm:ss.fff', Result);

Re: Firebird stored procedure returning void dataset raise exception

Posted: 01.09.2022, 08:26
by Fr0sT
mm is for minutes when following hh

Re: Firebird stored procedure returning void dataset raise exception

Posted: 01.09.2022, 10:37
by abk964
Thanks. Docs say so, but it does not work in Delphi 7. Not sure, than it's really important. Check for myself.

Re: Firebird stored procedure returning void dataset raise exception

Posted: 05.09.2022, 16:20
by abk964
Solved both problem by changing TZStoredProc to TZReadOnlyQuery with SQL:

Code: Select all

SELECT * FROM VOID_TEST_PROC(:P0)
Works both with FB 3 and 2.5