Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Changing a column
Sbaiz wrote:
>
> Hi to all
> is there a way, in Oracle, to modifiy a column name without dropping the
> table
> maintaining its data. I know that others databases permit changing the name
> of
> the column or dropping a column, but Oracle not.
> It would be nice if Oracle can modify the column name or generate the
> scripts
> by itself, taking care of all the constraints.
>
> Thanks in advance.
> Pierluigi S.
Hi,
The only way to change the column name from (Y TO C) in tab1 is
1. CREATE TABLE TEMP (A,B,C)
AS
SELECT A,B,Y FROM TABLE TAB1;
DROP TABLE TAB1;
RENAME TEMP TO TAB1 (Remember you have to recreate the constraints)
-- ***************************************************************** AMARENDRA B NETTEM Oracle Certified DBA (OCP) Whittman-Hart Inc., 311 South Wacker Drive, Suite 3500 Chicago, IL 60606. Residence: ----------- 5039 N E River Road, Apt. 1A NORRIDGE, IL 60656 Ph.No. (708) 583 9870 (H) (312) 913 6758 (W) E-mail:nettama_at_charlie.cns.iit.edu, anettem_at_whittman-hart.com Homepage: http://www.iit.edu/~nettama **************************************************************** Opinions are mine and do not necessarily reflect those of Whittman-hart Inc.Received on Wed Apr 22 1998 - 00:00:00 CDT