home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbaltbind.ex < prev    next >
Encoding:
Text File  |  1993-04-22  |  585 b   |  24 lines

  1. DBCHAR    name[20];
  2. DBINT     namecount;
  3.  
  4. /* read the query into the command buffer */
  5. dbcmd(dbproc, "select name from emp compute count(name)");
  6.  
  7. /* send the query to \*S */
  8. dbsqlexec(dbproc);
  9.  
  10. /* get ready to process the results of the query */
  11. dbresults(dbproc);
  12.  
  13. /* bind the regular row data -- name */
  14. dbbind(dbproc, 1, STRINGBIND, (DBINT) 0, name);
  15.  
  16. /* bind the compute column data -- count of name */
  17. dbaltbind(dbproc, 1, 1, INTBIND, (DBINT) 0, (BYTE *) &namecount);
  18.  
  19. /* now process each row */
  20. while (dbnextrow(dbproc) != NO_MORE_ROWS)
  21. {
  22.     C-code to print or process row data
  23. }
  24.