Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COUNTING RECORDS

Status
Not open for further replies.

jscorpion

Programmer
Nov 17, 2000
40
US
THIS SHOULD BE EASY, BUT I CAN'T REMEMBER HOW TO DO IT. I WANT TO DO A SELECT STATEMENT AND CREATE A FIELD THAT INCREMENTS WITH EACH RECORD SO IF THERE ARE FOUR RECORDS THE NEW FIELD LETS CALL IT COUNT1 WILL BE POPULATED WITH 1-4.

ANY HELP WILL BE GREATLY APPRECIATED.

THANK YOU.
 
Hello,

are you want to do the select within an application or direct on the sqlbase database ??
 
Hello... from a gupta application you can use the function SqlGetResultSetCount( ) to get the number of rows in the result-set of your SQL-Statement. But if you use this function you must acivate the result-set of this specified connection-handle with SqlSetResultSet( TRUE ).
Don´t forget to disable the result set after the execution with SqlSetResultSet( FALSE ). If you don´t do this this handle will be use more memory as needed in the following opperations.
 
thanks for your response, but I just want an sql statement that will due this. This is not part of an application just a query.

Thanks

jscorpion
 
hmmm... I only know the function "rowcount" but you only can use it to get total number of rows in a table and not on a specified sql statement...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top