home *** CD-ROM | disk | FTP | other *** search
- .Na "dbnumalts"
- .Aa
- .Fu
- Return the number of columns in a compute row.
- .Ih "compute row, number of columns in"
- .Sy
- .Sf "int dbnumalts(dbproc, computeid)"
- .Sp "DBPROCESS" "*dbproc"
- .Sp "int" "computeid"
- .Co
- .Bl
- .I "dbnumalts()"
- returns the number of columns in a compute row.
- The application can call this routine after
- .I "dbresults()"
- returns SUCCEED.
- For example, given the SQL statement:
- .SD
- .in +5n
- .ne 3
- select dept, year, sales from employee
- order by dept, year
- compute avg(sales), min(sales), max(sales) by dept
- .in -5n
- .ED
- the call
- .I "dbnumalts(dbproc, 1)"
- will return 3.
- .Bz
- .Pa
- .Pi dbproc
- A pointer to the DBPROCESS structure that provides the connection
- for a particular front-end/\*S process. It contains all the
- information that \*L uses to manage communications and data between the
- front end and \*S.
- .Pi 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 \f2computeid\f1 corresponding to the
- first COMPUTE clause in a SELECT is 1.
- The \f2computeid\f1 is returned by \f2dbnextrow()\f1
- or \f2dbgetrow().\f1
- .in -.375i
- .Re
- .br
- The number of columns for the particular
- .I "computeid".
- \f2dbnumalts()\f1 returns -1 if
- .I "computeid"
- is invalid.
- .Sa
- dbadata,
- dbadlen,
- dbaltlen,
- dbalttype,
- dbgetrow,
- dbnextrow,
- dbnumcols
-