SQL/MX 3.2.1 Management Manual (H06.26+, J06.15+)
when 'AV' then 'AVAILABLE'
when 'UO' then 'OFFLINE'
when 'UC' then 'CORRUPT'
when 'UD' then 'DROPPED'
when 'UR' then 'RECREATED'
end as status
from partitions p, objects o
where
o.object_name_space = 'TA' and
o.object_name = 'CUSTOMER' and
o.object_uid = p.object_uid and
o.schema_uid =
(select schema_uid
from nonstop_sqlmx_<sys name>.system_schema.schemata
where
schema_name = 'SALES' and
cat_uid =
(select cat_uid
from nonstop_sqlmx_<sys name>.system_schema.catsys
where cat_name = 'SAMDBCAT'
)
)
for read uncommitted access;
STATUS
------------------
FIRST_KEY
-----------
MAX_EXT
--------
DATA_SOURCE
-----------------------
AVAILABLE160$SYSTEM
Displaying Constraint Information
Topics in this subsection:
• “Determining Whether a Table Has Constraints” (page 136)
• “Displaying all Constraints on a Table” (page 137)
• “Displaying the Attributes of a Constraint” (page 138)
Related topics:
• “Displaying all Columns in a Primary Key or Unique Constraint” (page 140)
• “Displaying all Columns in a NOT NULL Constraint” (page 141)
• “Displaying all Columns in a Referential Integrity Constraint” (page 142)
The TBL_CONSTRAINTS table, located in the schema
DEFINITION_SCHEMA_VERSION_version-number of each catalog, describes all constraints
on a table. For more information about all metadata tables, see Figure 3 (page 109) in this manual
or the SQL/MX Reference Manual.
All queries for information about a specific partition must access information from the CATSYS,
SCHEMATA, and OBJECTS tables, and from the TBL_CONSTRAINTS table.
Determining Whether a Table Has Constraints
Use the MXCI SHOWDDL command to display the approximate CREATE TABLE statement that
might have created that table. To obtain information about indexes, use the MXCI SHOWLABEL
INDEX command. For examples of the SHOWDDL and SHOWLABEL commands, see the SQL/MX
Reference Manual.
This example counts the number of constraints for the table SAMDBCAT.SALES.CUSTOMER:
>> set schema samdbcat.definition_schema_version_<schema version>;
--- SQL operation complete.
136 Querying SQL/MX Metadata










