www.oradev.com   for Oracle developers
  Pl/sql articles   Oracle articles   Performance   scripts   Books   Documentation   Links   XML
  Articles
Number format
Sequence
Use XML in the database
Using XML functions
Oracle training
Oracle certification
Create statistics
dbms_profiler explained
How to use hints
Rename tables, columns
Scheduling in 10g
How to WAP in pl/sql
How to redirect a page
How to secure your webserver
How to use utl_http
How to Trace sessions




  Rename tables, columns

Rename tables, columns and constraints in Oracle

In more recent versions of Oracle you can rename tables, columns and constraints. Here are examples of the syntax:
ALTER TABLE table_name RENAME COLUMN column_name TO
new_column_name; (from Oracle9i Release 2)

ALTER TABLE table_name RENAME TO new_table_name;

ALTER TABLE table_name RENAME CONSTRAINT
constraint_name TO new_constraint_name;

ALTER INDEX index_name RENAME TO new_index_name;

It's also possible to drop a column:
ALTER TABLE table_name DROP COLUMN column_name;