Hi all ;
Without deleting records in a table , can we change datatype in oracle 10g and 11g ?
SQL> desc emp
Name Null? Type
----------------------------------------- -------- ----------------------------
NO NUMBER
NAME VARCHAR2(10)
CITY VARCHAR2(15)
DEP_ID NUMBER
SQL> select * from emp;
NO NAME CITY DEP_ID
---------- ---------- --------------- ----------
1 madhir calcutta 10
SQL> alter table emp modify(dep_id varchar2(5));
alter table emp modify(dep_id varchar2(5))
*
ERROR at line 1:
ORA-01439: column to be modified must be empty to change datatype
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production