home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / usr / sybase / doc / dbnumcols.man < prev    next >
Encoding:
Text File  |  1993-04-22  |  2.2 KB  |  89 lines

  1.  
  2.   1                       Version 4.0 -- 5/1/89                dbnumcols
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  dbnumcols
  6.  
  7.   FUNCTION:
  8.        Determine the number of regular columns for the  current  set  of
  9.        results.
  10.  
  11.   SYNTAX:
  12.        int dbnumcols(dbproc)
  13.  
  14.        DBPROCESS *dbproc;
  15.  
  16.   COMMENTS:
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   dbnumcols               Version 4.0 -- 5/1/89                        2
  25.   ______________________________________________________________________
  26.  
  27.        o dbnumcols() returns the number of regular  (i.e.,  non-compute)
  28.          columns in the current set of results.
  29.        o Here's  a  program  fragment  that  illustrates  the   use   of
  30.          dbnumcols():
  31.  
  32.          int             column_count;
  33.          DBPROCESS       *dbproc;
  34.  
  35.          /* put the commands into the command buffer */
  36.          dbcmd(dbproc, "select name, id, type from sysobjects");
  37.          dbcmd(dbproc, " select name from sysobjects");
  38.  
  39.          /* send the commands to SQL Server and start execution */
  40.          dbsqlexec(dbproc);
  41.  
  42.          /* process each command until there are no more */
  43.  
  44.  
  45.  
  46.   3                       Version 4.0 -- 5/1/89                dbnumcols
  47.   ______________________________________________________________________
  48.          while (dbresults(dbproc) != NO_MORE_RESULTS)
  49.          {
  50.              column_count = dbnumcols(dbproc);
  51.              printf("%d columns in this SQL Server result.\n",
  52.                  column_count);
  53.              while (dbnextrow(dbproc) != NO_MORE_ROWS)
  54.                  printf("row received.\n");
  55.          }
  56.  
  57.  
  58.   PARAMETERS:
  59.        dbproc -  A pointer to the DBPROCESS structure that provides  the
  60.            connection for a particular front-end/SQL Server process.  It
  61.            contains all the information that DB-Library uses  to  manage
  62.            communications and data between the front end and SQL Server.
  63.  
  64.   RETURNS:
  65.  
  66.  
  67.  
  68.   dbnumcols               Version 4.0 -- 5/1/89                        4
  69.   ______________________________________________________________________
  70.        The number of columns in the current set of  results.   If  there
  71.        are no columns, dbnumcols() returns 0.
  72.  
  73.   SEE ALSO:
  74.        dbcollen, dbcolname, dbnumalts
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.