SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
C-166
CREATE VIEW Statement
SALESREP PIC X(4) NO DEFAULT NOT NULL,
CUSTNUM PIC X(4) NO DEFAULT NOT NULL,
PRIMARY KEY ( ORDERNUM ) )
PARTITION ($VOL2.SALES.ORDERS FIRST KEY “D”,
$VOL3.SALES.ORDERS FIRST KEY “K”,
$VOL4.SALES.ORDERS FIRST KEY “S”)
FORMAT 2;
This example creates a Format 2 enabled table with four partitions. The first three
partitions are Format 1 and the last is Format 2:
CREATE TABLE $VOL1.SALES.ORDERS (
ORDERNUM PIX X(6) NO DEFAULT NOT NULL,
ORDER_DATE PIC X(6) NO DEFAULT NOT NULL,
DELIV_DATE PIC X(6) NO DEFAULT NOT NULL,
SALESREP PIC X(4) NO DEFAULT NOT NULL,
CUSTNUM PIC X(4) NO DEFAULT NOT NULL,
PRIMARY KEY ( ORDERNUM ) )
PARTITION ($VOL2.SALES.ORDERS FIRST KEY “D”, FORMAT 1
$VOL3.SALES.ORDERS FIRST KEY “K”, FORMAT 1
$VOL4.SALES.ORDERS FIRST KEY “S”,FORMAT 2)
PARTITION ARRAY FORMAT2ENABLED;
CREATE VIEW Statement
CREATE VIEW is a DDL statement that creates a view.
view
specifies a Guardian name for the view (or an equivalent DEFINE). The fully
expanded view name must be unique among object names in the network.
The volume on which the view is created must be audited by the TMF subsystem,
even if the view itself is nonaudited.
CREATE VIEW view [ ( new-name [ , new-name ] ... ) ]
AS select-statement
[| FOR PROTECTION |]
[| SIMILARITY CHECK { ENABLE | DISABLE } |]
[| CATALOG catalog-name |]
[| SECURE "rwep" |]
[| WITH CHECK OPTION |]
[| WITH HEADINGS |]
[| WITH HELP TEXT |]
new-name is:
new-column-name [ HEADING string | NO HEADING ]