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

  1. DBPROCESS       *dbproc;
  2. int             colnum;
  3. DBINT           column_length;
  4.  
  5. /* put the command into the command buffer */
  6. dbcmd(dbproc, "select name, id, type 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 column lengths */
  15. for (colnum = 1; colnum < 4; colnum++)
  16. {
  17.     column_length = dbcollen(dbproc, colnum);
  18. .ne 3
  19.     printf("column %d, length is %ld.\\n", colnum, 
  20.         column_length);
  21. }
  22.