Newbie needs help

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
tonio
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 21.11.2008, 10:53

Newbie needs help

Post by tonio »

Hi !

I'd just like to know how I can retrieve the result of a query like this one :

ZQuery.SQL.Text := 'SELECT COUNT(*) FROM `cars` WHERE `manuf` = 1';
ZQuery.open;


By the way, do u know where I can find comprehensive documentation for Zeoslib/Delphi ?


Thanks !

tonio
tonio
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 21.11.2008, 10:53

Post by tonio »

I've just found an answer to my 1st question :)

ZQuery.Fields[0].value;
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

An other way is using an alias in your query : 'select count(*) as countval from...'
Then you can use the ZQuery.FieldByName('countval').Value construct.

Mark
Image
tonio
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 21.11.2008, 10:53

Post by tonio »

Smart !

Thanks
Post Reply