Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Sybase DB Library C 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

  1                       Version 4.0 -- 5/1/89                 dbaltlen
  ______________________________________________________________________

  NAME:  dbaltlen

  FUNCTION:
       Return the maximum length of the data for  a  particular  compute
       column.

  SYNTAX:
       DBINT dbaltlen(dbproc, computeid, column)

       DBPROCESS *dbproc;
       int       computeid;
       int       column;







  dbaltlen                Version 4.0 -- 5/1/89                        2
  ______________________________________________________________________

  COMMENTS:

       o This routine returns the maximum length for a column in a  com-
         pute  row.   In  the  case of variable length data, this is not
         necessarily the actual length of the data, but rather the  max-
         imum length. For the actual data length, use dbadlen().

         For example, given the SQL statement:

              select dept, name from employee
                order by dept, name
                compute count(name) by dept

         the call dbaltlen(dbproc, 1, 1) returns 4 because counts are of
         SYBINT4 type, which is 4 bytes long.




  3                       Version 4.0 -- 5/1/89                 dbaltlen
  ______________________________________________________________________

  PARAMETERS:
       dbproc -  A pointer to the DBPROCESS structure that provides  the
           connection for a particular front-end/SQL Server process.  It
           contains all the information that DB-Library uses  to  manage
           communications and data between the front end and SQL Server.
       computeid -  The id that identifies the particular compute row of
           interest.   A  SQL SELECT statement may have multiple COMPUTE
           clauses, each of which returns a separate compute  row.   The
           computeid  corresponding  to  the  first  COMPUTE clause in a
           SELECT is 1.  The computeid is  returned  by  dbnextrow()  or
           dbgetrow().
       column -  The number of the column of interest.  The first column
           is number 1.

  RETURNS:
       The maximum  length,  in  bytes,  possible  for  the  data  in  a



  dbaltlen                Version 4.0 -- 5/1/89                        4
  ______________________________________________________________________
       particular compute column.  -1 is returned if there  is  no  such
       column or COMPUTE clause.

  SEE ALSO:
       dbadata, dbadlen, dbalttype, dbgetrow, dbnextrow, dbnumalts














Typewritten Software • bear@typewritten.org • Edmonds, WA 98026