TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: Darin McBride
from: Neil Heller
date: 2003-02-02 11:38:00
subject: Declaring a pointer to a

DM> SELECT COUNT(*), AVG(income) FROM tbl WHERE ...

DM> then you'd get one row, but two columns - column 1 is the 
DM> count, and column 2 is the average of the income column in 
DM> the tbl table, both using only the subset that matches the 
DM> WHERE condition.

I like it.  However, COUNT(*) is not one of my own variables and there 
is no documentation in Watcom that tells me exactly what is returned:  
long, word or byte.  However, a little experimenting shouldn't be very 
difficult and should tell me exactly what I need to know.  Thanks for 
the idea.


DM>> SQLINTEGER count;
DM>> if (retcode == SQL_SUCCESS || retcode ==
DM>> SQL_SUCCESS_WITH_DATA) {
DM>>   SQLINTEGER cb;
DM>>   SQLGetData(bstmt, &count, 0, &cb);

Upon re-reading this, I'll have to try it.

þ CMPQwk 1.42 999

--- Maximus/2 3.01
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
SEEN-BY: 633/267 270
@PATH: 106/2000 1 379/1 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.