Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Example of using ALTER to add columns
In article <1997Feb18.182158.24845_at_schbbs.mot.com> a10377_at_email.mot.com (Michael Duke) writes:
> Could anyone show me an example of using ALTER to add
> columns to a table? Is it as simple as
>
> ALTER TABLE tablename
> rowname rowtype,
> rowname rowtype;
>
> Thanks in advance,
> Michael
> a10377_at_email.mot.com
Almost. Try:
ALTER TABLE tablename
ADD ( column_name_1 datatype_1, column_name_2 datatype_2, ..., column_name_n datatype_n );
Default values and constraints for each new column can appear between the data type and the following comma. They may also appear in a MODIFY clause following the ADD clause or in a following ALTER TABLE statement.
--Andy -- ------------------------------------------------------- | Andrew G. Tompkins | #include <disclaimer.std.h> | | Software Design Eng. ------------------------------| | Tektronix, Inc. | | Measurment Business Div./Instruments Business Unit | | Phone: (503) 627-5172 fax: (503) 627-5548 | | email: Andrew.Tompkins_at_tek.com (work) | | andytom_at_teleport.com (home) | | http://www.teleport.com/~andytom/ | -------------------------------------------------------Received on Wed Feb 19 1997 - 00:00:00 CST
![]() |
![]() |