SQL/MX 3.2.1 Management Manual (H06.26+, J06.15+)

Displaying the Attributes of a Constraint
This example displays some of the attributes of the constraints in the table
SAMDBCAT.SALES.CUSTOMER. To display additional fields, select the fields from the
TBL_CONSTRAINTS table:
>> set schema samdbcat.definition_schema_version_<schema version>;
--- SQL operation complete.
>> select t.constraint_uid,
t.table_uid,
case t.constraint_type
when 'C' then 'CHECK'
when 'F' then 'FOREIGN'
when 'P' then 'PRIMARY KEY'
when 'U' then 'UNIQUE'
end as type,
t.droppable
from tbl_constraints t,
objects o
where t.table_uid = o.object_uid
and o.object_name = 'CUSTOMER'
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;
DROPPABLE
---------
TYPE
-----------
TABLE_UID
--------------------
CONSTRAINT_UID
--------------------
N
N
CHECK
PRIMARY KEY
1950548695248899591
1950548695248899591
1950548695248911751
1950548695248913034
Displaying Column Information
Topics in this subsection:
“Displaying all Columns in a Table” (page 139)
“Displaying all Columns in a View” (page 139)
“Displaying all Columns in an Index” (page 140)
“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)
“Displaying the Attributes of a Column” (page 143)
“Displaying all Tables Containing a Selected Column” (page 143)
Related topic:
“Displaying all Privileges for a Column” (page 146)
The COLS table, located in the schema DEFINITION_SCHEMA_VERSION_version-number of
each catalog, describes the columns in all tables and views in that catalog. For more information
about all metadata tables, see Figure 3 (page 109) in this manual or the SQL/MX Reference Manual.
138 Querying SQL/MX Metadata