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

  1. DBPROCESS       *dbproc;
  2. DBINT           row_number = 0;
  3. DBINT           object_id;
  4.  
  5. /* put the command into the command buffer */
  6. dbcmd(dbproc, "select id from sysobjects");
  7.  
  8. /* send the command to \*S and begin execution */
  9. dbsqlexec(dbproc);
  10.  
  11. /* process the command results */
  12. dbresults(dbproc);
  13.  
  14. /* examine the data in each row */
  15. while (dbnextrow(dbproc) != NO_MORE_ROWS)
  16. {
  17.     row_number++;
  18.     object_id = *((DBINT *)dbdata(dbproc, 1));
  19.     printf("row %ld, object id is %ld.\\n", row_number, 
  20.         object_id);
  21. }
  22.