SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)
Querying SQL/MX Metadata
HP NonStop SQL/MX Installation and Management Guide—523723-004
8-48
Displaying the Attributes of a Constraint
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_1200;
--- 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_figaro.system_schema.schemata
 where
 schema_name = 'SALES' and
 cat_uid =
 (select cat_uid
 from nonstop_sqlmx_figaro.system_schema.catsys
 where cat_name = 'SAMDBCAT'
 )
 )
 for read uncommitted access;
CONSTRAINT_UID TABLE_UID TYPE DROPPABLE
-------------------- -------------------- ----------- ---------
6739911021285913237 6739911021285877390 CHECK N 
6739911021285920606 6739911021285877390 PRIMARY KEY N 
Displaying Column Information
Topics in this subsection:
•
Displaying All Columns in a Table on page 8-50
•
Displaying All Columns in a View on page 8-51
•
Displaying All Columns in an Index on page 8-52
•
Displaying All Columns in a Primary Key or Unique Constraint on page 8-53
•
Displaying All Columns in a NOT NULL Constraint on page 8-54










