Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I use this comand to get rows of a table.
SQLExecDirect(..,(SQLCHAR*)"select * from table1", ..)

I can access rows sequentialy by calling SQLFetch but I want to know the count of rows in the result set. How can I do this?

Thanks in advance
Posted
Updated 13-Dec-10 1:42am
v2

select count(*)As COUNT from table1
 
Share this answer
 
v2
Comments
mr.abzadeh 11-Dec-10 9:05am    
Yes, I could add COUNT(*) to my SELECT statement but the result set has been passed to me so I can not change the query statement.
I want to get count of rows in an already existing result set.

Thanks for your interest
SELECT Count(*) AS counter FROM (select * from table1)WHERE fieldname=value

I think this will help you
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900