1.1

Table Of Contents
SET ASYNCEVENTLISTENER ( [listener-name] [, listener-name] * )
}
Description
See also ALTER TABLE Limitations on page 687.
See also Identity ColumnsGENERATED ALWAYS Identity ColumnsGENERATED BY DEFAULT Identity
Columns on page 478.
Adding columns and table-level constraints follows the same syntax as the CREATE TABLE on page 476
statement.
When you add columns with the ADD COLUMN clause, you can also place a column constraint on the new
column, as shown above. However, you can add a column with a NOT NULL constraint to an existing table
only if a default value is provided; otherwise an exception is thrown.
When you add constraints or a primary key, the existing table data is veried to satisfy the constraint. If the
existing data violates the constraint, the alteration fails and a constraint violation exception is thrown.
You cannot drop a primary key column, or any column that is used for table partitioning.
Dropping a column from the table can throw a constraint violation if related object data has become invalid.
This behavior applies to the RESTRICT clause, which is used by default. CASCADE deletes are not supported.
The schema objects that can cause a DROP COLUMN RESTRICT to be rejected include views, triggers, primary
key constraints, foreign key constraints, unique key constraints, check constraints, and column privileges.
You cannot drop the last remaining column in a table. Also, DROP COLUMN is not allowed if
sqlre.sql-authorization is true. When a column is dropped, it is removed from any indexes that contain it, and
the indexes are rebuilt if required. If that column was the only column in the index, then the entire index is
dropped.
The DROP CONSTRAINT clause drops a constraint on an existing table. To drop an unnamed constraint, specify
the generated constraint name stored in SYS.SYSCONSTRAINTS as a delimited identier. Dropping a primary
key constraint, unique constraint, or a foreign key constraint drops the physical index that enforces the constraint.
You can use the ALTER COLUMN clause after importing existing identity column values (in a non-identity
column) to change the column to a GENERATED ALWAYS AS IDENTITY column. (GENERATED ALWAYS
identity columns do not allow manual insertion of identity values.) After executing the statement, SQLFire
automatically generates identity values for new rows, and ensures that new identity values are greater than the
last imported value at the time you executed the ALTER TABLE command. See sqlf write-schema-to-db and
sqlf write-data-to-db for more information. See also Auto-Generated Columns on page 687.
The SET EVICTION MAXSIZE clause enables you to change the eviction LRUMEMSIZE setting for the table.
See EVICTION BY Clause on page 489.
The SET GATEWAYSENDER and SET ASYNCEVENTLISTNER clauses enable you to change or remove
the gateway senders and asynceventlisteners associated with a table. The new list of senders or listeners that you
specify in each clause replaces the current conguration. Do not specify a name to remove all gateway sender
or AsyncEventListener congurations from a table, as shown in the examples below.
Example
- create a table with no constraints
CREATE TABLE trade.customers (
cid int not null,
cust_name varchar(100),
addr varchar(100),
tid int);
-- add a primary key constraint with no data in the table
ALTER TABLE trade.customers add constraint cust_pk primary
459
SQL Language Reference