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

Table Of Contents
s.cat_uid =
(select cat_uid from
nonstop_sqlmx_<sys name>.system_schema.catsys c
where c.cat_name = 'SAMDBCAT' and
schema_version = 3000
)
)
for read uncommitted access;
CONSTRAINT_NAME
-----------------------
TYPE
-----------
COL_NUM
----------
COLUMN_NAME
-------------
ODETAIL_545675672_5188PRIMARY KEY0ORDERNUM
ODETAIL_545675672_5188PRIMARY KEY1PARTNUM
Displaying all Columns in a NOT NULL Constraint
This example displays all columns with NOT NULL constraints for the table
SAMDBCAT.SALES.ODETAIL:
>>set schema samdbcat.definition_schema_version_<schema version>;
>> select substring(c.column_name, 1, 15) as column_name,
c.column_number as col_num,
case o2.object_type
when 'CC' then 'CHECK'
when 'NN' then 'NOT NULL'
when 'RC' then 'FOREIGN KEY'
when 'PK' then 'PRIMARY KEY'
when 'UC' then 'UNIQUE'
else 'UNKNOWN'
end as type,
substring(o2.object_name , 1, 24) as constraint_name
from cols c,
objects o1,
objects o2,
ck_col_usage k,
tbl_constraints t
where c.object_uid = t.table_uid
and k.constraint_uid = t.constraint_uid
and k.column_number = c.column_number
and t.table_uid = o1.object_uid
and o1.object_name = 'ODETAIL'
and o2.object_uid = t.constraint_uid
and o1.schema_uid =
(select schema_uid from
nonstop_sqlmx_<sys name>.system_schema.schemata s
where s.schema_name = 'SALES' and
s.cat_uid =
(select cat_uid from
nonstop_sqlmx_<sys name>.system_schema.catsys c
where c.cat_name = 'SAMDBCAT' and
schema_version = 3000
)
)
for read uncommitted access;
CONSTRAINT_NAME
----------------------
TYPE
-----------
COL_NUM
----------
COLUMN_NAME
-------------
ODETAIL_793765672_5188
ODETAIL_793765672_5188
NOT NULL
NOT NULL
0
1
ORDERNUM
PARTNUM
ODETAIL_793765672_5188
ODETAIL_793765672_5188
NOT NULL
NOT NULL
2
3
UNIT_PRICE
QTY_ORDERED
Displaying Column Information 141