NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
A-34
ALTER TABLE Statement
For more detail about ALLOCATE, MAXEXTENTS, or RESETBROKEN, see the
ALLOCATE File Attribute on page A-6, MAXEXTENTS File Attribute on
page M-2, or RESETBROKEN File Attribute on page R-22 entries. For more
information about INCOMPLETE PARTITION CHANGE, see the discussion about
completing operations in Considerations—ALTER TABLE
on page A-35.
ADD PARTITION new-part add-spec
adds a partition named new-part to table name using the options specified in
add-spec. When specifying new-part, include the volume, subvolume, and file
name of the partition.
If ServerWare SMF is installed, the volume can be a virtual or direct volume name.
If you specify only a subvolume and file name, SQL creates a new index partition in
the current default volume. If you specify a virtual volume, SQL creates a new index
partition in the virtual volume. In all other cases, SQL creates a new index partition
in the physical volume and the new partition is a direct file not managed by
ServerWare SMF.
You must use ADD PARTITION to add a partition to a table with relative or entry-
sequenced file organization. For tables with key-sequenced organization, you can
use the MOVE clause to add a partition; ADD PARTITION is equivalent to the one-
way split form of the MOVE clause.
add-spec
specifies options for a partition added with the ADD PARTITION clause.
The FIRST KEY clause specifies the primary or clustering key value for the first
key allowed in a new partition of a table with key-sequenced file organization. It is
required for key-sequenced files. val is a literal compatible with the data type of
the key column that specifies the key value. For clustering keys, specify multiple
vals, in order.
The FIRST KEY clause does not apply to tables with relative or entry-sequenced
file organization; ADD PARTITION adds an empty partition to the end of a relative
or entry-sequenced file.
The WITH DATA MOVEMENT clause directs SQL to transfer appropriate rows
from name to dest-part. If you do not specify WITH DATA MOVEMENT,
ADD PARTITION creates an empty partition and returns an error if records exist
within the FIRST KEY declaration of the new partition.
add-spec also includes options that allow you to specify a catalog for the new
partition, a physical volume if DSM/Storage Manager is installed, and to set the
EXTENT and MAXEXTENTS file attributes for the partition. These options are the
same as options described under move-spec earlier in this entry.
REUSE PARTITION reused-part reuse-spec
reuses a partition, specified in reused-part, using the options specified in
reuse-spec. When specifying reused-part, include the volume, subvolume,
and file name of the partition.