How to know total fetched rows

Forum related to the ZDBC API-Layer

Moderators: gto, cipto_kh, EgonHugeist

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

How to know total fetched rows

Postby Babblo » 30.06.2010, 19:07

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:

Postby mdaems » 29.08.2010, 22:06

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

Postby Babblo » 29.08.2010, 22:55

Ok Mark, thanks for the answer ;)


Return to “ZDBC (ZEOS Database Connectivity)”

Who is online

Users browsing this forum: No registered users and 1 guest