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

Table Of Contents
The VWS table is the definition schema table that lists all views in a catalog. Text for views is stored
separately in the TEXT table. For more information about all metadata tables, see Figure 3 (page 108)
in this manual or the SQL/MX Reference Manual.
All queries for information about a specific view must access information from the CATSYS,
SCHEMATA, and OBJECTS tables, and from the VWS table.
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_<schema version>;
--- SQL operation complete.
>>select substring (object_name, 1, 25) as view_name,
object_name_space as name_space
from nonstop_sqlmx_<system name>.system_schema.catsys c,
nonstop_sqlmx_<system name>.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;
NAME_SPACE
----------
VIEW_NAME
-------------------------
TA
TA
CUSTLIST
ORDREP
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_<schema version>;
--- SQL operation complete.
>> select substring (object_name, 1, 20) as object_name,
check_option, is_updatable, is_insertable
from nonstop_sqlmx_<system name>.system_schema.catsys c,
nonstop_sqlmx_<system name>.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;
IS_INSERTABLE
-------------
IS_UPDATABLE
------------
CHECK_OPTION
------------
OBJECT_NAME
--------------------
Y
N
Y
N
N
N
CUSTLIST
ORDREP
Displaying Information About Views 129