SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)

Querying SQL/MX Metadata
HP NonStop SQL/MX Installation and Management Guide523723-004
8-51
Displaying All Columns in a View
Displaying All Columns in a View
This example displays all columns in the view SAMDBCAT.SALES.CUSTLIST:
>> set schema samdbcat.definition_schema_version_1200;
--- SQL operation complete.
>> select substring(column_name, 1, 25) as column_name,
column_number
from cols c, objects o
where
c.object_uid = o.object_uid and
o.object_name = 'CUSTLIST' and
o.object_type = 'VI' and
o.schema_uid =
(select schema_uid
from nonstop_sqlmx_figaro.system_schema.schemata
where
schema_name = 'SALES' and
cat_uid =
(select cat_uid
from nonstop_sqlmx_figaro.system_schema.catsys
where cat_name = 'SAMDBCAT'
)
)
order by column_number
for read uncommitted access;
COLUMN_NAME COLUMN_NUMBER
------------------------- -------------
CUSTNUM 0
CUSTNAME 1
STREET 2
CITY 3
STATE 4
POSTCODE 5