Purpose
The TABLEID command displays the table number of the specified table when given the database name and table name.
Syntax
- databasename
- The name of the database containing the table for which the table number will be displayed.
- tablename
- The name of the table for which the table number will be displayed.
Usage Notes
This command is not allowed if the Teradata Database is in the Debug-Stop state.
A table is identified in the Data Dictionary by a table number (tvm.tvmid). Each table number is unique across the whole system, rather than local to a database. Therefore, a table number uniquely identifies a table in the system.
The TABLEID command displays the table number of the table specified by databasename and tablename. The output of the TABLEID command is a numeric subtable identifier (tid), which consists of three numbers:
- The first two comprise the table number. This pair of numbers is used to uniquely identify a table in the system.
- The third is the typeandindex value, which specifies a kind of subtable, such as a table header, data subtable, or a particular index subtable. TABLEID always returns a typeandindex value of zero (0), which specifies the table header.
For more information on how to interpret a tid, see Specifying a Subtable Identifier (tid).
The TABLEID command also sets the saved context to the located tid. (Use = in place of tid in subsequent commands to reference the found tid.)
The following rules apply when specifying databasename and tablename:
- A period (.) is required to separate the database name from the table name.
- You must use either apostrophes ( ' ) or double quotation marks ( " ) when typing a database name and table name. The results are the same.
- You can specify a fully qualified table name using any one of the methods suggested in the syntax diagram with the following exceptions:
- The object name itself includes an apostrophe, in which case you must enclose the object name within double quotation marks.Valid examples include the following:
- tableid "xyz.mark's table"
- tableid "xyz"."mark's table"
Invalid examples include the following:- tableid 'xyz.mark's table'
- tableid "xyz".'mark's table'
- The object name has a period, in which case you must type the fully qualifying tablename in the form of “database”.”tablename” or 'database'.'tablename'.Valid examples include the following:
- tableid "xyz.0's"."mark's table.2.53.00"
- tableid 'xyz'.'table.0'
Invalid examples include the following:- tableid "xyz.0's.mark's table.2.53.00"
- tableid 'xyz.0's.mark's table.2.53.00'
- The object name itself includes an apostrophe, in which case you must enclose the object name within double quotation marks.