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                 dbbylist
  ______________________________________________________________________

  NAME:  dbbylist

  FUNCTION:
       Return the bylist for a compute row.

  SYNTAX:
       BYTE *dbbylist(dbproc, computeid, size)

       DBPROCESS *dbproc;
       int       computeid;
       int       *size;








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

  COMMENTS:

       o dbbylist() returns the bylist for a  compute  row.   (A  SELECT
         statement's COMPUTE clause may contain the keyword BY, followed
         by a list of  columns.   This  list,  known  as  the  "bylist,"
         divides the results into subgroups, based on changing values in
         the specified columns.  The COMPUTE clause's row  aggregate  is
         applied  to  each  subgroup,  generating a compute row for each
         subgroup.)
       o dbresults() must return SUCCEED before  the  application  calls
         this routine.

       o Assume the following command has been executed:






  3                       Version 4.0 -- 5/1/89                 dbbylist
  ______________________________________________________________________
              select dept, name, year, sales from employee
                order by dept, name, year
                compute count(name) by dept,name

         The call dbbylist(dbproc, 1, &size) sets  size  to  2,  because
         there  are two items in the bylist.  It returns a pointer to an
         array of two BYTES, which contain the values 1 and 2,  indicat-
         ing  that  the  bylist  is composed of columns 1 and 2 from the
         select-list.

  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



  dbbylist                Version 4.0 -- 5/1/89                        4
  ______________________________________________________________________
           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().
       size -  A pointer to an integer, which  dbbylist()  sets  to  the
           number of elements in the bylist.

  RETURNS:
       A pointer to an array of BYTEs  containing  the  numbers  of  the
       columns  that  compose the bylist for the specified compute.  The
       array of BYTEs is part of the DBPROCESS, so you must not free it.
       If the computeid is out of range, NULL is returned.

       Call dbcolname() to derive the name of a column from its number.
       The size of the array is returned in the size parameter.  A  size
       of 0 indicates that either there is no bylist for this particular
       compute or the computeid is out of range.



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

  SEE ALSO:
       dbadata,  dbadlen,  dbaltlen,  dbalttype,  dbcolname,   dbgetrow,
       dbnextrow















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