Thursday, September 28, 2006

Syntax 1

To add a column to an existing table, the ALTER TABLE syntax is:

ALTER TABLE TableName
 ADD ColumnName column-definition;

For example:

ALTER TABLE yourtable
 ADD yourcolumn  varchar2(50);

This will add a column called yourcolumn to the yourtable table.


Syntax 2

To add multiple columns to an existing table, the ALTER TABLE syntax is:

ALTER TABLE TableName
ADD ( column1 column-definition,
column2 column-definition,
...
columnn column_definition );

For example:

ALTER TABLE yourtable
ADD ( yourcolumn1 varchar2(50),
yourcolumn2 varchar2(45) );

This will add two columns (yourcolumn1 and yourcolumn2) to the yourtable table.

9/28/2006 2:00:16 PM (Mitteleuropäische Sommerzeit , UTC+02:00)  #    Disclaimer  |  Comments [0]  |