Oracle Rename Column - alter table, rename column Example SQL Syntax

By M&S Consulting (Ashok) on Jun 1st, 2009
Filed Under Technical Tips // Tags:

Following is simple example syntax for renaming a column to an Oracle table using “alter table” SQL:

1
2
ALTER TABLE [my_table_name]
RENAME COLUMN [current_column_name] TO [new_column_name];

A simple example would be:

1
2
ALTER TABLE employee
RENAME COLUMN f_name TO first_name;

Like renaming an Oracle table, you should be aware of any dependencies in code, etc. that reference a table column by name. Oracle does make the required changes within a database in many cases, but of course, you should ensure all is working and update any components that reside outside the database. You can use tools like TOAD to easily check dependencies on a table in a visual manner. Below is a screenshot within TOAD of the “Used By” tab that can be accessed when your table is selected in the schema browser:

used_by

Bookmark and Share

Related Information:

  1. Oracle Rename Table - Example Syntax and Dependencies
    Renaming a table in Oracle is simple. Following is the generic Oracle table rename syntax: 1 ALTER TABLE current_table_name RENAME...
  2. alter table, add column - Oracle Example Syntax
    Following is simple example syntax for adding a column to an Oracle table using “alter table” SQL: 1 2 ALTER...
  3. Oracle Materialized View DDL
    Are you a TOAD fanatic when it comes to “anything-Oracle”? If so, you probably realized that TOAD will not show...
  4. Copy Table Columns and Data
    As you may know, in Oracle the syntax from creating a table that is the same as another is: 1...
  5. TOAD for Oracle 9 or TOAD 10 - 64-bit Windows - ORA-12154: could not resolve the connect identifier specified or ORA-6413: connection not open
    I recently downloaded the new 10.x version of TOAD and could not connect to my databases. Still running TOAD 9.x,...
  6. Oracle TO_DATE Function - SQL Syntax Examples
    The Oracle TO_DATE SQL function is used to convert a TEXT or NTEXT representation of a date into an Oracle...
  7. SQL LIKE - Oracle LIKE Operator - SQL Syntax Examples
    The reserved word LIKE in Oracle SQL represents an operator that performs some basic matching on text. LIKE provides a...
  8. Oracle SUBSTR with INTSR Function - SQL Syntax Examples
    Oracle SUBSTR and INSTR SQL functions are typically used together in practice for parsing a string. Following are...

One Response to “Oracle Rename Column - alter table, rename column Example SQL Syntax”

  1. sharanabasava
    Jun 30, 2010
    Reply

    ALTER TABLE [my_table_name]
    RENAME COLUMN [current_column_name] TO [new_column_name];

    Sir,I executed this command for altering the column name in my table but its giving the following error

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



Leave a Reply


Archives

Recent Comments

  • Kavitha Muniraj said: Hi, Could you please send a script which checks the status of forms and reports of oracle...
  • Siddharth said: Hey thanks a lot !! Have been lookin all over for this :) My PC may not be able t handle FlashBuilder...
  • Cyrex said: Hey man why I cant install Apex 4? is there anyone can help me.,?
  • sharanabasava said: ALTER TABLE [my_table_name] RENAME COLUMN [current_column_name] TO [new_column_name]; Sir,I...
  • Huub Vankan said: Thanks for this easy solution. Indeed strange that is does not work in the (x86) folder….

Calendar

July 2010
M T W T F S S
« Jun    
 1234
567891011
12131415161718
19202122232425
262728293031  

Featured Testimonial

"M&S has taken 'partnership' to a new level. They are not only a deeply skilled service provider, the M&S team is actually a mission critical component to our operations, taking on new initiatives as well as maintaining custom, open source, and COTS solutions."

CEO, MedPivot

Free SQL Service