How to know total fetched rows

Forum related to the ZDBC API-Layer

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Babblo
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 07.06.2009, 23:28

How to know total fetched rows

Post 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.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
Babblo
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 07.06.2009, 23:28

Post by Babblo »

Ok Mark, thanks for the answer ;)
Post Reply