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

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