Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

how to change the column datatype to number from varchar2 in oracle10g

612739Dec 10 2007 — edited Mar 19 2012
hi i created one table in oracle 10g in that table i took one column data type as varchar2
ex:desc user;
Name Null? Type
----------------------------------------- -------- ----------------------------
USERID NOT NULL VARCHAR2(5)
FIRSTNAME NOT NULL VARCHAR2(15)
LASTNAME VARCHAR2(15)
EMPID VARCHAR2(5)
USERNAME VARCHAR2(20)
PASSWORD NOT NULL VARCHAR2(20)
MOBILE NUMBER(12)
EMAILID VARCHAR2(20)

but i don't want to take userid as varchar i want to change it as number
for this i tried with alter statement like:
alter table user modify(UserId number(5));
but i'm getting this error:
column type incompatible with referenced column type
how to resolve this one, here i'm using oracle 10g rl2
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 16 2012
Added on Dec 10 2007
10 comments
146,457 views