1.0

Table Of Contents
-- add a primary key constraint with no data in the table
ALTER TABLE trade.customers add constraint cust_pk primary
key (cid);
- add a new unique key constraint
ALTER TABLE trade.customers add constraint cust_uk unique
(tid);
-- add a new foreign key constraint to a child table;
- each row is checked to make sure it satisfies the new
constraint
CREATE TABLE trade.portfolio (
cid int not null,
sid int not null,
qty int not null,
availQty int not null,
tid int,
constraint portf_pk primary key (cid, sid));
ALTER TABLE trade.portfolio add constraint
cust_fk foreign key (cid) references trade.customers (cid)
on delete restrict;
- drop the unique and foreign key constraints added above
ALTER TABLE trade. customers drop constraint cust_uk;
ALTER TABLE trade.portfolio drop constraint cust_fk;
-- drop a non-primary key column if the table has no data and
the column has no dependents
ALTER TABLE trade.customers drop column addr;
- add the column back when table has no data with a default
value
ALTER TABLE trade.customers add column addr varchar(100);
-- change a non-identity column with existing identity values
to GENERATED ALWAYS AS IDENTITY
ALTER TABLE maps ALTER COLUMN map_id SET GENERATED ALWAYS AS
IDENTITY;
-- add a gateway sender configuration to a table that was
created without any senders
ALTER TABLE maps SET GATEWAYSENDER (uksender);
-- add a second gateway sender configuration to the "maps"
table:
ALTER TABLE maps SET GATEWAYSENDER (uksender, apacsender);
-- remove one gateway sender configuration from the "maps"
table:
ALTER TABLE maps SET GATEWAYSENDER (apacsender);
-- remove all gateway sender configurations from "maps:"
ALTER TABLE maps SET GATEWAYSENDER ();
See also ALTER TABLE Limitations on page 653.
vFabric SQLFire User's Guide434
vFabric SQLFire Reference