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

Creating an SQL/MX Database
HP NonStop SQL/MX Installation and Management Guide544536-007
7-21
Additional Guidelines for Creating Tables
Example for Creating an SQL/MX Table With Multiple Range Partitions
CREATE TABLE cat1.sch1.ordersr
(location char(16) not null not droppable,
ordernumber integer unsigned not null not droppable,
ordertime timestamp,
primary key (location, ordernumber) not droppable)
location $DATA01
partition(
add first key ('Chicago') location $DATA02,
add first key ('New York') location $DATA03 );
Example for Creating an SQL/MX Table With a Single Hash Partition
CREATE TABLE cat1.sch1.ordersh
(location char(16) not null not droppable,
ordernumber integer unsigned not null not droppable,
ordertime timestamp,
primary key (location, ordernumber) not droppable)
location $DATA01
hash partition;
Example for Creating an SQL/MX Table With Multiple Hash Partitions
CREATE TABLE cat1.sch1.ordersh
(location char(16) not null not droppable,
ordernumber integer unsigned not null not droppable,
ordertime timestamp,
primary key (location, ordernumber) not droppable)
location $DATA01
hash partition(
add location $DATA02,
add location $DATA03);
Additional Guidelines for Creating Tables
When moving a table from a development environment to a production
environment, changes made to the partitioning scheme of the table from one
environment to the next can cause similarity check failures in embedded SQL
programs that query the table. These would include:
°
Changing the columns that compose the table’s partitioning key.
°
Changing from range partitioning to hash partitioning.
°
Changing the number of partitions in the table.
For more information, see similarity check criteria in the SQL/MX Programming
Manual for C and COBOL.
Specify table attributes that are best for the performance, access, size, and
protection of the data in the table:
°
Use EXTENTS, MAXEXTENTS, and ALLOCATE, if applicable, for controlling
the size of the table.