Product Documentation

c-treeACE V11.0 Update Guide

Previous Topic

Next Topic

Extended ALTER VIEW, ALTER TABLE, and ALTER INDEX Flexibility

ALTER functionality has been extended for multiple SQL actions, including views, indexes and tables.

ALTER VIEW

Now, an existing view can be replaced with a new view definition, retaining existing view permissions (which would be lost with DROP VIEW/CREATE VIEW).

Example

ALTER VIEW customers_by_zip AS SELECT cmname, cmaddress FROM custmaster ORDER BY cmzipcode;

ALTER INDEX for Renaming Indexes

ALTER INDEX now supports renaming an index or adding a new storage attribute such as partitioning

Example

ALTER INDEX oi_ordrnumb_idx ON ordernum RENAME TO new_oi_ordrnumb_idx;

ALTER INDEX co_ordrdate_partidx ON custordr STORAGE_ATTRIBUTES 'partition=QUARTER(co_ordrdate)';

ALTER TABLE for Renaming Tables

ALTER TABLE now supports renaming tables, columns, and constraints.

Examples

ALTER TABLE custmaster RENAME TO archive_custmaster;

ALTER TABLE custmaster RENAME COLUMN cmzipcode TO cmzipcode_plusseven;

ALTER TABLE orderitem RENAME CONSTRAINT oi_ordrnumb TO new_oi_ordrnumb;

TOCIndex