ALLBASE/SQL Reference Manual (36216-90216)

Chapter 10 301
SQL Statements A - D
ALTER TABLE
ALTER TABLE
The ALTER TABLE statement is used to add one or more new columns or constraints, to
drop one or more constraints, or to reassign the table audit partition. This statement is
also used to change the type of table access, updatability, and locking strategies. New
columns are appended following already existing columns of a table. New column
definitions must either allow null values or provide default values if the table is not empty.
Added columns may specify constraints.
Scope
ISQL or Application Programs
SQL Syntax
ALTER TABLE [
Owner.
]
TableName
{
AddColumnSpecification
AddConstraintSpecification
DropConstraintSpecification
SetTypeSpecification
SetPartitionSpecification
}
Parameters—ALTER TABLE
[
Owner
.]
TableName
designates the table to be altered.
AddColumnSpecification
allows a new column to be added to an existing table. This
parameter is discussed in a separate section below.
AddConstraintSpecification
allows a new constraint to be added to an existing
table. This parameter is discussed in a separate section
below.
DropConstraintSpecification
allows an existing constraint to be dropped from an
existing table. This parameter is discussed in a separate
section below.
SetTypeSpecification
allows the locking mode of the table and related
authorities to be changed. This parameter is discussed in a
separate section below.
SetPartitionSpecification
allows a table or DBEnvironment partition to be
changed.
SQL Syntax—AddColumnSpecification
ADD { (
ColumnDefinition
[,...])
ColumnDefinition
} [CLUSTERING ON CONSTRAINT [
ConstraintID
]]
Parameters—AddColumnSpecification
ColumnDefinition
The syntax of
ColumnDefinition
is presented under the