home *** CD-ROM | disk | FTP | other *** search
- DBCHAR name[20];
- DBINT namecount;
-
- /* read the query into the command buffer */
- dbcmd(dbproc, "select name from emp compute count(name)");
-
- /* send the query to \*S */
- dbsqlexec(dbproc);
-
- /* get ready to process the results of the query */
- dbresults(dbproc);
-
- /* bind the regular row data -- name */
- dbbind(dbproc, 1, STRINGBIND, (DBINT) 0, name);
-
- /* bind the compute column data -- count of name */
- dbaltbind(dbproc, 1, 1, INTBIND, (DBINT) 0, (BYTE *) &namecount);
-
- /* now process each row */
- while (dbnextrow(dbproc) != NO_MORE_ROWS)
- {
- C-code to print or process row data
- }
-