TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: Jasen Betts
from: Neil Heller
date: 2003-01-28 18:09:00
subject: Declaring a pointer to a

NH> I've found that a linked list works great for passing
NH> information for which the number of items can't be known
NH> before-hand.

JB> once you get the result can't you ask for a count of the records
JB> then make an array?

I use "Watcom SQL" version 4 - that's the last version Watcom made 
before they sold the SQL package to Sybase (now it's known as SQL 
Anywhere).  I had a programmer friend at Sybase, but he got the axe 
(along with a large number of others in a personnel cutback) so now I'm 
out in the cold.

The following command works perfectly in the Watcom interactive 
environment:

select count (*) from  where 

The count command became part of the SQL standard in SQL-92.  
Unfortunately, I have not been able to find a corresponding command in 
ODBC.  If I were to use the count command in an SQLExecDirect statement, 
I don't have a clue as to how I could retrieve any sort of return value.

================== example =============================

 HENV  benv;
 HDBC  bdbc;
 HSTMT bstmt;

 wsprintf(char_str,     // wsprintf is a Windoze work-alike
 "SELECT count (*) FROM Names WHERE %s LIKE '%c%s%c' OR %s LIKE / 
'%c%s%c' ORDER BY %s",
    "Name", "grp", "Name", '%', target, '%',
"Sortstr", '%', target,
    '%', "Sortstr");

 char_to_uchar or you could pass any object that has access to the query result and
JB> methods similar to those of a linked list.

That would result in calling SQL queries outside of the database class:  
something to which I am (at this point) loathe to do.

JB> I've seen badly written database applications die horribly when the
JB> number of users climbed, but those guys weren't even using odbc 
JB> AFAIK. if they were they could have goone with a big SQL 
JB> server
JB> whaty they were doing instead was relying on shared DBF files...

Ack... x-base.  Actually there IS an ODBC driver for x-base 
applications.  However, I don't think that would help a great deal.

þ 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™.