Home » SQL & PL/SQL » SQL & PL/SQL » RENAME TABLE COLUMN
RENAME TABLE COLUMN [message #49489] Fri, 11 February 2005 01:47 Go to next message
Chaitanya
Messages: 7
Registered: May 2002
Junior Member
Suppose i have a table with columns:

eno name rollno

i want to rename the columns as

empnumber name rollnumber

suggset sql query to rename column name?
Re: RENAME TABLE COLUMN [message #49491 is a reply to message #49489] Fri, 11 February 2005 04:03 Go to previous messageGo to next message
MikeL
Messages: 15
Registered: January 2005
Junior Member
As taken from 9i Administration Guide:
"Oracle allows you to rename existing columns in a table. Use the RENAME COLUMN
clause of the ALTER TABLE statement to rename a column. The new name must not
conflict with the name of any existing column in the table. No other clauses are
allowed in conjunction with the RENAME COLUMN clause.
The following statement renames the comm column of the hr.admin_emp table.
ALTER TABLE hr.admin_emp
RENAME COLUMN comm TO commission;
As noted earlier, altering a table’s column can invalidate dependent objects.
However, when you rename a column, Oracle updates associated data dictionary
tables to ensure that function-based indexes and check constraints remain valid."
Re: RENAME TABLE COLUMN [message #49495 is a reply to message #49491] Fri, 11 February 2005 21:29 Go to previous messageGo to next message
Chaitanya
Messages: 7
Registered: May 2002
Junior Member
I tried the below command to rename the column of a table:

alter table try rename column name to ename;

but i m getting below error message:

ERROR at line 1:
ORA-14155: missing PARTITION or SUBPARTITION keyword

Plz suggest ??
Re: RENAME TABLE COLUMN [message #49504 is a reply to message #49491] Sun, 13 February 2005 04:34 Go to previous message
Chaitanya
Messages: 7
Registered: May 2002
Junior Member
thanx mikel.
Previous Topic: (Urgent)How to deal with long column in Oracle8i
Next Topic: SubQueries - Help .
Goto Forum:
  


Current Time: Mon Aug 04 22:04:25 CDT 2025