SQL/MX 3.1 Installation and Management Guide (H06.23+, J06.12+)
Querying SQL/MX Metadata
HP NonStop SQL/MX Release 3.1 Installation and Management Guide—663852-001
8-52
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_<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;
CONSTRAINT_UID TABLE_UID TYPE DROPPABLE
-------------------- -------------------- ----------- ---------
1950548695248911751 1950548695248899591 CHECK N
1950548695248913034 1950548695248899591 PRIMARY KEY N
Displaying Column Information
Topics in this subsection:
Displaying All Columns in a Table on page 8-54
Displaying All Columns in a View on page 8-55
Displaying All Columns in an Index on page 8-56
Displaying All Columns in a Primary Key or Unique Constraint on page 8-57
Displaying All Columns in a NOT NULL Constraint on page 8-58










