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