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

  1.  
  2.   1                       Version 4.0 -- 5/1/89                 dbcollen
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  dbcollen
  6.  
  7.   FUNCTION:
  8.        Return the maximum length of the data in a regular result column.
  9.  
  10.   SYNTAX:
  11.        DBINT dbcollen(dbproc, column)
  12.  
  13.        DBPROCESS *dbproc;
  14.        int       column;
  15.  
  16.   COMMENTS:
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   dbcollen                Version 4.0 -- 5/1/89                        2
  25.   ______________________________________________________________________
  26.  
  27.        o This routine returns the maximum length of the data in a  regu-
  28.          lar (i.e., non-compute) result column.  In the case of variable
  29.          length data, this is not necessarily the actual length  of  the
  30.          data,  but rather the maximum length that the data can be.  For
  31.          the actual data length, use dbdatlen().
  32.        o Here's a small program fragment that uses dbcollen():
  33.  
  34.          DBPROCESS       *dbproc;
  35.          int             colnum;
  36.          DBINT           column_length;
  37.  
  38.          /* put the command into the command buffer */
  39.          dbcmd(dbproc, "select name, id, type from sysobjects");
  40.  
  41.          /* send the command to SQL Server and begin execution */
  42.          dbsqlexec(dbproc);
  43.  
  44.  
  45.  
  46.   3                       Version 4.0 -- 5/1/89                 dbcollen
  47.   ______________________________________________________________________
  48.  
  49.          /* process the command results */
  50.          dbresults(dbproc);
  51.  
  52.          /* examine the column lengths */
  53.          for (colnum = 1; colnum < 4; colnum++)
  54.          {
  55.              column_length = dbcollen(dbproc, colnum);
  56.              printf("column %d, length is %ld.\n", colnum,
  57.                  column_length);
  58.          }
  59.  
  60.  
  61.   PARAMETERS:
  62.        dbproc -  A pointer to the DBPROCESS structure that provides  the
  63.            connection for a particular front-end/SQL Server process.  It
  64.            contains all the information that DB-Library uses  to  manage
  65.  
  66.  
  67.  
  68.   dbcollen                Version 4.0 -- 5/1/89                        4
  69.   ______________________________________________________________________
  70.            communications and data between the front end and SQL Server.
  71.        column -  The number of the column of interest.  The first column
  72.            is number 1.
  73.  
  74.   RETURNS:
  75.        The maximum length, in bytes, of  the  data  for  the  particular
  76.        column.  If the column number is not in range, dbcollen() returns
  77.        -1.
  78.  
  79.   SEE ALSO:
  80.        dbcolname, dbcoltype, dbdata, dbdatlen, dbnumcols
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.