Page 1 of 1

How to know total fetched rows

Posted: 30.06.2010, 19:07
by Babblo
Hi, Im new with Zeos Lib and Im doing some basic test...

For this one, Im trying to know how many rows have a resultset after a simple select, so i try with GetFetchSize but allways return 0.

This is what im doing. (Using ZeosLib 6.6.6 - Delphi 7)

Code: Select all

var
  C : IZConnection;
  S : IZStatement;
  R : IZResultSet;
begin

  C := DriverManager.GetConnection('zdbc:mysql-5://host/testDB?UID=USER;PWD=PASS');
  C.Open;

  S := C.CreateStatement;
  R := S.ExecuteQuery('SELECT * FROM testTable');
  ShowMessage(IntToStr(R.GetFetchSize)); 

  C.Close;
end;
Thanks in advance.

Posted: 29.08.2010, 22:06
by mdaems
I'm afraid there's no way doing this without doing a call to r.last and then checking the active row usinf r.getrow

Mark

Posted: 29.08.2010, 22:55
by Babblo
Ok Mark, thanks for the answer ;)