dbtabname

Returns the name of a table based on its number.

Syntax

LPCSTR dbtabname (
PDBPROCESS
dbproc,
INT
tabnum );

where

dbproc
Is the DBPROCESS structure that is the handle for a particular workstation/ SQL Server process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.
tabnum
Is the number of the table. Table numbers start with 1. Use dbtabcount to find out the total number of tables involved in a particular statement.

Returns

A pointer to the null-terminated name of the specified table. This pointer is NULL if the table number is out of range or if the specified table is a SQL Server work table. For a description of work tables, see "dbtabcount."

Remarks

The dbtabname function is one of the DB-Library browse-mode functions. For a detailed discussion of browse mode, see Browse Mode in Programming with DB-Library.

A SELECT statement can generate a set of result rows whose columns are derived from several database tables. The database tables are specified by the FROM clause. The dbtabname function provides a way for an application to determine the name of each table involved in an ad hoc query. If the query has been hard-coded into the program, this function is unnecessary.

The dbtabname function can be called any time after dbresults.

See Also

dbcolbrowse, dbcolsource, dbqual, dbresults, dbtabbrowse, dbtabcount, dbtabsource, dbtsnewlen, dbtsnewval, dbtsput; Bulk-Copy Functions