SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-165
Examples of REGISTER CATALOG
Suppose that you create a view that references two tables in different catalogs:
CREATE VIEW view_catalog.view_schema.MYVIEW4
(v_ordernum, v_partnum) AS
SELECT od.ordernum, p.partnum
FROM SALES.SALES_SCHEMA.ODETAIL OD
INNER JOIN CUST.CUST_SCHEMA.ORDERS P
ON od.partnum = p.partnum;
If you issue either of these commands:
REGISTER CATALOG SALES ON \nodex.$data47;
REGISTER CATALOG SALES ON \nodex.$data47 RESTRICT;
NonStop SQL/MX returns an error because catalog SALES is related to catalog
CUST by this view, and view_catalog is related to both. The command defaults to
the RESTRICT option.
If you issue this command:
REGISTER CATALOG SALES ON \nodex.$data47 CASCADE;
NonStop SQL/MX registers all three catalogs, SALES, CUST, and view_catalog, on
\nodex because they are related to each other by this view.
Suppose that you create two views that are indirectly related to each other:
CREATE VIEW cat1.sch.v AS
SELECT * FROM cat2.sch.t;
CREATE VIEW cat2.sch.v AS
SELECT * FROM cat3.sch.t;
In this example, cat1 and cat3 are each directly related to cat2, and each is
indirectly related to the other. You must register all three catalogs (or one of them
withe the CASCADE option) so that their tables will be visible on another node.