ALTER TABLE

<< Click to Display Table of Contents >>

Navigation:  Apollo SQL > DDL & DML Statements >

ALTER TABLE

The ALTER TABLE command is used to create new data tables. A table name and corresponding list of column definitions required.

image\tip.gif Apollo products implement an 'ExecSQL' method or function which must be used to execute a CREATE TABLE or ALTER TABLE statement.

Syntax:

ALTER TABLE table_reference

DROP [COLUMN] column_reference | ADD [COLUMN] column_reference [, DROP [COLUMN] column_reference | ADD [COLUMN] column_reference...]

Example

ALTER TABLE MyTable DROP FullName, ADD LastName CHAR(25)

 

To change a column, you must drop the current definition first, then add the new column definition.