HP 3000 Manuals

ALTER TABLE [ ALLBASE/Replicate User's Guide ] MPE/iX 5.0 Documentation


ALLBASE/Replicate User's Guide

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 the
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 

                              {AddColumnSpecification     }
                              {AddConstraintSpecification }
ALTER TABLE [Owner.]TableName {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 the ALLBASE/SQL Reference Manual.

AddConstraintSpecification   allows a new constraint to be added to an
                             existing table.  This parameter is discussed
                             in the ALLBASE/SQL Reference Manual.

DropConstraintSpecification  allows an existing constraint to be dropped
                             from an existing table.  This parameter is
                             discussed in the ALLBASE/SQL Reference 
                             Manual.

SetTypeSpecification         allows you to convert a table type to
                             PUBLICROW, PUBLIC, PUBLICREAD, or PRIVATE.
                             This parameter is discussed in the
                             ALLBASE/SQL Reference Manual.

SetPartitionSpecification    allows the table partition to be set or
                             changed for future audit logging on this
                             table.  This parameter is discussed in a
                             separate section below.

SQL Syntax--SetPartitionSpecification 

              {PartitionName}
SET PARTITION {DEFAULT      }
              {NONE         }
Parameters--SetPartitionSpecification 

PartitionName           specifies the new partition for the table.

DEFAULT                 specifies the new partition of the table to be
                        the default partition of the DBEnvironment.  If
                        the default partition number is later changed,
                        that change will automatically be picked up by
                        future audit logging on this table.  The
                        partition number assigned to the default
                        partition is determined at the time the INSERT,
                        UPDATE, or DELETE operation is executed on the
                        table.  If the default partition is NONE at that
                        time, audit log records are produced, but they
                        are not replicated.

NONE                    specifies that the table is no longer in any
                        partition.  No further audit logging will be done
                        on the table.

Description 

   *   Specify partition NONE to indicate that a table is not in any
       partition.

   *   The partition specified must be one previously defined in a CREATE
       PARTITION statement, be the DEFAULT partition, or be NONE.

   *   SET PARTITION sets the partition of the table to be the specified
       partition.  All future audit logging on the table will use this
       new partition.  If NONE is specified, this table will not be
       replicated (until another ALTER TABLE SET PARTITION statement is
       issued on the table).

   *   Past audit log records will not be altered to reflect a change in
       a table's partition; that is, the effect of this statement is not
       retroactively applied to existing log records.

Authorization 

You can issue this statement if you have ALTER or OWNER authority for the
table or if you have DBA authority.

Example 

     The table's partition is modified to be partition PartsPart2. 

     ALTER TABLE PurchDB.Parts
              SET PARTITION PartsPart2; 

     Audit logging is not done on the table. 

     ALTER TABLE PurchDB.Parts
              SET PARTITION NONE; 



MPE/iX 5.0 Documentation