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

SQL/MX Clauses
HP NonStop SQL/MX Reference Manual540440-003
7-22
STORE BY Clause
STORE BY Clause
Considerations for STORE BY
The STORE BY clause determines the order of rows within the physical file that holds
the table, and has an effect on how you can partition the object.
STORE BY store-option
specifies a set of columns on which to base the clustering key. The clustering key
determines the order of rows within the physical file that holds the table. The
storage order has an effect on how you can partition the object.
store-option is defined as:
PRIMARY KEY
bases the clustering key on the primary key columns. This store option
requires that the primary key is NOT DROPPABLE. If the primary key is
defined as DROPPABLE, NonStop SQL/MX returns an error.
key-column-list
bases the clustering key on the columns in the key-column-list. The key
columns in key-column-list must be specified as NOT NULL NOT
DROPPABLE and cannot have a combined length of more than 247 bytes.
The default is PRIMARY KEY if you specified a PRIMARY KEY clause that has the
NOT DROPPABLE constraint in the CREATE TABLE statement.
If you omit the STORE BY clause and you do not specify a PRIMARY KEY that
has the NOT DROPPABLE constraint, the storage order is determined only by the
SYSKEY. You cannot partition a table stored only by SYSKEY. See SYSKEYs on
page 6-59.
STORE BY store-option
store-option is:
PRIMARY KEY
| (key-column-list)
key-column-list is:
column-name [ASC[ENDING] | DESC[ENDING]]
[,column-name [ASC[ENDING] | DESC[ENDING]]]...