home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbgetoff.ex < prev    next >
Encoding:
Text File  |  1993-04-22  |  504 b   |  19 lines

  1. int        select_offset[10];
  2. int        last_offset;
  3. int        i;
  4.  
  5. /* set the offset option */
  6. dbsetopt(dbproc, DBOFFSET, "select");
  7.  
  8. /* Assume the command buffer contains the following SELECTs */
  9. dbcmd(dbproc, "select x = 100 select y = 5");
  10.  
  11. /* send the query to \*S */
  12. dbsqlexec(dbproc);
  13.  
  14. /* Get all the offsets to the SELECT keyword */
  15. for (i = 0, last_offset = 0; last_offset != -1; i++)
  16.     if ((last_offset = dbgetoff(dbproc, OFF_SELECT, last_offset)) 
  17.         != -1)
  18.         select_offset[i] = last_offset++;
  19.