renaming column !

Go down

renaming column !

Post by mightyganesh on Fri Mar 19, 2010 12:51 pm

how to rename a column with out affecting the datatype and the data stored in the table under that column

i.e.
SQL> desc employees_g;
Name Null? Type
----------------------------------------- -------- ----------------------------
EMP# NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(15)
LAST_NAME VARCHAR2(15)
PHONE_NO NUMBER(10)
HIRE_DATE DATE
SALARY NUMBER(6)

this is a table if i want to rename the column EMP# to EMP_ID how can i do with out affecting the data stored!
avatar
mightyganesh

Posts : 53
Points : 92
Join date : 2010-02-26
Age : 30

View user profile http://ganeshguna.blogspot.com

Back to top Go down

Re: renaming column !

Post by Christopher on Fri Mar 19, 2010 2:28 pm

Code:
ALTER TABLE EMPLOYEES_G RENAME COLUMN EMP# TO EMP_ID;
avatar
Christopher
Admin

Posts : 240
Points : 429
Join date : 2010-02-26
Age : 30

View user profile http://unixcpp.forumotion.com

Back to top Go down

Re: renaming column !

Post by mightyganesh on Fri Mar 19, 2010 3:57 pm

it worked! Smile
avatar
mightyganesh

Posts : 53
Points : 92
Join date : 2010-02-26
Age : 30

View user profile http://ganeshguna.blogspot.com

Back to top Go down

Re: renaming column !

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum