SQL/MX 3.2 Management Manual (H06.25+, J06.14+)

Table Of Contents
“Displaying the Attributes of a Table” (page 127)
“Displaying all Tables on a System” (page 128)
Related topics:
“Locating System Schema Tables” (page 112)
“Locating System Defaults Schema Tables” (page 114)
“Determining Whether a Table has Indexes” (page 131)
“Displaying all Indexes for a Table” (page 132)
“Displaying the State of Indexes for a Table” (page 134)
“Displaying all Partitions for a Table or Index” (page 134)
“Determining Whether a Table Has Constraints” (page 136)
“Displaying all Constraints on a Table” (page 137)
“Displaying all Columns in a Table” (page 138)
“Displaying all Privileges for a Table” (page 144)
For more information about metadata tables, see Figure 3 (page 108) in this manual or the SQL/MX
Reference Manual.
All queries for information about a specific table object must access information from the CATSYS,
SCHEMATA, and OBJECTS tables, and from the appropriate specific table (for example, the COLS
table or the PARTITIONS table).
Displaying all Tables in a Catalog
This example displays all base table objects in the catalog SAMDBCAT:
>> set schema samdbcat.definition_schema_version_schema version>;
--- SQL operation complete.
>> select substring (object_name, 1, 25) as table_name,
substring(schema_name, 1, 30) as schema_name
from nonstop_sqlmx_<system name>.system_schema.catsys c,
nonstop_sqlmx_<system name>.system_schema.schemata s,
objects o
where c.cat_uid = s.cat_uid
and c.cat_name = 'SAMDBCAT'
and s.schema_uid = o.schema_uid
and o.object_type = 'BT'
order by schema_name, table_name
for read uncommitted access;
SCHEMA_NAME
------------------------------
TABLE_NAME
-------------------------
DEFINITION_SCHEMA_VERSION_3000
DEFINITION_SCHEMA_VERSION_3000
ACCESS_PATHS
ACCESS_PATH_COLS
DEFINITION_SCHEMA_VERSION_3000CK_COL_USAGE
DEFINITION_SCHEMA_VERSION_3000CK_TBL_USAGE
DEFINITION_SCHEMA_VERSION_3000COLS
DEFINITION_SCHEMA_VERSION_3000COL_PRIVILEGES
DEFINITION_SCHEMA_VERSION_3000DDL_LOCKS
DEFINITION_SCHEMA_VERSION_3000DDL_PARTITION_LOCKS
DEFINITION_SCHEMA_VERSION_3000EXCEPTION_USAGE
DEFINITION_SCHEMA_VERSION_3000KEY_COL_USAGE
DEFINITION_SCHEMA_VERSION_3000MP_PARTITIONS
DEFINITION_SCHEMA_VERSION_3000MVGROUPS
DEFINITION_SCHEMA_VERSION_3000MVS
DEFINITION_SCHEMA_VERSION_3000MVS_COLS
DEFINITION_SCHEMA_VERSION_3000MVS_JOIN_COLS
DEFINITION_SCHEMA_VERSION_3000MVS_TABLE_INFO
Displaying Table Information 125