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-36
Displaying All Views in a Schema
Displaying All Views in a Schema
This example displays all views in the schema SALES in the catalog SAMDBCAT:
>>set schema samdbcat.definition_schema_version_1200;
--- SQL operation complete.
>>select substring (object_name, 1, 25) as view_name,
object_name_space as name_space
from nonstop_sqlmx_figaro.system_schema.catsys c,
nonstop_sqlmx_figaro.system_schema.schemata s,
objects o
where c.cat_uid = s.cat_uid
and c.cat_name = 'SAMDBCAT'
and s.schema_uid = o.schema_uid
and s.schema_name = 'SALES'
and o.object_type = 'VI'
order by object_name
for read uncommitted access;
VIEW_NAME NAME_SPACE
------------------------- ----------
CUSTLIST TA
ORDREP TA
Displaying the Attributes of a View
This example displays all the attributes for views in the schema SALES in the catalog
SAMDBCAT:
>> set schema samdbcat.definition_schema_version_1200;
--- SQL operation complete.
>> select substring (object_name, 1, 20) as object_name,
check_option, is_updatable, is_insertable
from nonstop_sqlmx_figaro.system_schema.catsys c,
nonstop_sqlmx_figaro.system_schema.schemata s,
objects o,
vws v
where c.cat_uid = s.cat_uid
and c.cat_name = 'SAMDBCAT'
and s.schema_uid = o.schema_uid
and s.schema_name = 'SALES'
and o.object_type = 'VI'
and v.object_uid = o.object_uid
order by object_name
for read uncommitted access;
OBJECT_NAME CHECK_OPTION IS_UPDATABLE IS_INSERTABLE
-------------------- ------------ ------------ -------------
CUSTLIST N Y Y
ORDREP N N N