Rename Column

Oracle9i New Feature Series: Rename Column

Oracle databases Oracle9i Release 2 and higher now allow you to rename a column in the table.

ALTER TABLE table_name RENAME COLUMN old_name TO new_name

Use the RENAME COLUMN clause of ALTER TABLE  to rename a column. The new column name must not be the same as any other column name in table.

Function-based indexes and check constraints that depend on the renamed column remain valid.

Dependent views, triggers, domain indexes, functions, procedures, and packages are marked INVALID. Oracle attempts to revalidate them when they are next accessed, but you may need to alter these objects with the new column name if revalidation fails.

You cannot combine this clause with any of the other column_clauses in the same statement.

You cannot rename a column that is used to define a join index. Instead you must drop the index, rename the column, and re-create the index.

Search BijooS.com Exact Match Search      
Home Oracle DBA TKMCE Alumni H1B Info Guestbook

Biju Thomas is Oracle7.3 OCP, Oracle8 OCP, 
Oracle8i OCP and Oracle9i OCA/OCP Certified DBA

Questions/Comments? Write to webmaster@bijoos.com. © The scripts, tips and articles appearing on BijooS.com cannot be reproduced elsewhere without the prior permission from the webmaster.