SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
P-18
Consideration—PARTITION
Consideration—PARTITION
Each partition you specify must follow the rules for partitions described in the entry
PARTITIONS.
Example—PARTITION
This example shows a CREATE TABLE statement that uses the PARTITION clause:
CREATE TABLE \SYS1.$VOL1.SALES.ODETAIL (
ORDERNUM NUMERIC (6) UNSIGNED NO DEFAULT NOT NULL,
PARTNUM NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL,
UNIT_PRICE NUMERIC (8,2) NO DEFAULT NOT NULL,
QTY_ORDERED NUMERIC (5) UNSIGNED NO DEFAULT NOT NULL,
PRIMARY KEY ( ORDERNUM , PARTNUM ) )
CATALOG \SYS1.$VOL1.SALES
ORGANIZATION KEY SEQUENCED
PARTITION (
\SYS1.$VOL2.SALES.ODETAIL
CATALOG \SYS1.$VOL1.SALES
EXTENT (16368,64)
MAXEXTENTS 944
FIRST KEY 030000
,
\SYS1.$VOL3.SALES.ODETAIL
CATALOG \SYS1.$VOL1.SALES
EXTENT (16368,64)
MAXEXTENTS 944
FIRST KEY 040000
,
... --indicates 20 more
\SYS5.$VOL1.SALES.ODETAIL --partition
CATALOG \SYS5.VOL1.SALES --specifications
EXTENT (16368,64)
MAXEXTENTS 944
FIRST KEY 980000 )
LOCKLENGTH 6
EXTENT (16368,64)
MAXEXTENTS 944
NOPURGEUNTIL OCT 31 2004, 23:59
NO AUDIT;
Some of the attributes specified apply to the entire table and some only to the primary
partition. NOPURGEUNTIL, NO AUDIT, and LOCKLENGTH apply to all partitions. The
example specifies NO AUDIT because the attribute can be changed to AUDIT after the
table will be loaded. The EXTENT and MAXEXTENTS attributes apply only to the
primary partition, for which \SYS1.$VOL1 and a first key of 000000 are assumed.