home *** CD-ROM | disk | FTP | other *** search
- .Na "dbtabcount"
- .mc |
- .Aa
- .Fu
- Return the number of tables involved in the current SELECT query.
- .Ih "table, determining number involved in SELECT query"
- .Sy
- .Sf "int dbtabcount(dbproc)"
- .Sp "DBPROCESS" "*dbproc"
- .Co
- .Bl
- \f2dbtabcount()\f1 is one of the \*L browse mode routines.
- It is usable only with results from a browse-mode SELECT (\f2i.e.,\f1
- a SELECT containing the key words FOR BROWSE).
- See the Introduction for a detailed discussion of browse mode.
- .Bl
- A SELECT query can generate a set of result rows whose columns are
- derived from several database tables.
- To perform browse-mode updates of columns in a query's \f2select-list\f1,
- the application must know how many tables were involved
- in the query, because
- each table requires a separate UPDATE statement.
- \f2dbtabcount()\f1 can provide this information for ad hoc queries.
- If the query has been hardcoded into the program, this routine is obviously unnecessary.
- .Bl
- The count returned by this routine includes any \*S ``work tables''
- used in processing the query.
- .Ih "work tables"
- .Ih "tables, work"
- The \*S sometimes creates temporary, internal work tables to process
- a query.
- It deletes these work tables by the time it finishes processing
- the statement.
- Work tables are not updatable and are not available to the application.
- Therefore, before using a table number,
- the application must make sure that it does not
- belong to a work table.
- \f2dbtabname()\f1 can be used to determine whether a particular
- table number refers to a work table.
- .Bl
- The application can call
- \f2dbtabcount()\f1 any time after \f2dbresults()\f1.
- .Bl
- Example 7 in the \f2\*L Reference Supplement\f1 contains a call to \f2dbtabcount()\f1.
- .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.
- .in -.375i
- .Re
- .br
- The number of tables, including \*S work tables, involved
- in the current set of row results.
- .sp 0.5v
- \f2dbtabcount()\f1 will return -1 in case of error.
- .Sa
- dbcolbrowse,
- dbcolsource,
- dbqual,
- dbtabbrowse,
- dbtabname,
- dbtabsource,
- dbtsnewlen,
- dbtsnewval,
- dbtsput
- .mc
-