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 Guide663852-001
8-38
Displaying the Attributes of a Table
Displaying the Attributes of a Table
This example displays some of the attributes of the base tables defined in the
SAMDBCAT.SALES schema:
>> set schema samdbcat.definition_schema_version_<schema
version>;
--- SQL operation complete.
>> select substring(object_name, 1, 15) as TABLENAME,
case object_security_class
when 'UM' then 'USER METADATA TABLE'
when 'UT' then 'USER-DEFINED TABLE'
when 'SM' then 'SYSTEM METADATA TABLE'
when 'MU' then 'OTHER'
end as SECURITY_CLASS,
create_time,
object_owner as owner
from objects
where object_type = 'BT'
and schema_uid =
(
select schema_uid
from nonstop_sqlmx_<system name>.system_schema.schemata
where
schema_name = 'SALES' and
cat_uid =
(select cat_uid
from nonstop_sqlmx_<sys_nam>.system_schema.catsys
where cat_name = 'SAMDBCAT'
)
)
for read uncommitted access
order by object_name;
TABLENAME SECURITY_CLASS CREATE_TIME OWNER
--------------- --------------------- -------------------- -----------
CUSTOMER USER-DEFINED TABLE 212159239083886027 65535
HISTOGRAMS USER METADATA TABLE 212159239072602110 65535
HISTOGRAMS_FREQ USER METADATA TABLE 212159239072602110 65535
HISTOGRAM_INTER USER METADATA TABLE 212159239072602110 65535
MVS_TABLE_INFO_ OTHER 212159239072602110 65535
MVS_UMD OTHER 212159239072602110 65535
MVS_USED_UMD OTHER 212159239072602110 65535
ODETAIL USER-DEFINED TABLE 212159239086666918 65535
ORDERS USER-DEFINED TABLE 212159239084274760 65535
PARTS USER-DEFINED TABLE 212159239086955851 65535