Results 1 to 3 of 3

Thread: rename

  1. #1
    Join Date
    Jun 2004
    Posts
    42

    Unanswered: rename

    Hi,
    can i rename a column in a table,or delete it.
    i had a field called emp_nme varchar2(100)

    and i need to change it to
    emp_name varchar2(100)

    i have already create the table and don't want to drop it.

    Thanks

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    alter table mytable rename column emp_nme to emp_name;

    alter table mytable drop column emp_name;
    Last edited by Littlefoot; 08-16-04 at 09:18.

  3. #3
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    On 9i or 10G it is simply:

    alter table t1 rename column emp_nme to emp_name;

    On 8i you could do this:

    alter table t1 add (emp_name varchar2(100));
    update t1 set emp_name = emp_nme;
    alter table t1 drop column emp_nme;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •