SQL/MX 3.2.1 Management Manual (H06.26+, J06.15+)
)
for read uncommitted access;
CONSTRAINT_NAME
----------------------
UPDATE_RULE
-----------
COL_NUM
----------
COLUMN_NAME
--------------
P1NA1PARTNUM
Displaying the Attributes of a Column
This example displays some of the attributes of the columns in the table
SAMDBCAT.PERSNL.EMPLOYEE. To display additional attributes, select different fields from the
COLS table:
>> set schema samdbcat.definition_schema_version_<schema version>;
--- SQL operation complete.
>> select substring(c.column_name, 1, 15) as column_name,
c.column_number as col_num,
c.sql_data_type,
case c.column_class
when 'S' then 'SYSTEM'
when 'U' then 'USER'
when 'A' then 'ADDED'
else 'OTHER'
end as col_class
from cols c, objects o
where
c.object_uid = o.object_uid and
o.object_name = 'EMPLOYEE' and
o.object_type = 'BT' and
o.schema_uid =
(select schema_uid
from nonstop_sqlmx_<sys name>.system_schema.schemata
where
schema_name = 'PERSNL' and
cat_uid =
(select cat_uid
from nonstop_sqlmx_<sys name>.system_schema.catsys
where cat_name = 'SAMDBCAT'
)
)
order by column_number
for read uncommitted access;
COL_CLASS
---------
SQL_DATA_TYPE
------------------
COL_NUM
-----------
COLUMN_NAME
---------------
USER
USER
UNSIGNED NUMERIC
CHARACTER
0
1
EMPNUM
FIRST_NAME
USERCHARACTER2LAST_NAME
USERUNSIGNED NUMERIC3DEPTNUM
USER
USER
UNSIGNED NUMERIC
UNSIGNED NUMERIC
4
5
JOBCODE
SALARY
Displaying all Tables Containing a Selected Column
This example displays all tables in schema SAMDBCAT.SALES that contain the column ORDERNUM
and displays the SQL data type of the column:
>> select substring(column_name, 1, 20) as column_name,
sql_data_type,
substring(object_name, 1, 20) as table_name
from cols c, objects o
where
Displaying Column Information 143










