Create table emp
(id number(9), name varchar2(20),salary
number(9,2));
The table has 100 records after table created.Now i nee to
change id's Datatype is to be Varchar2(15). now

Alter table emp modify(id varchar2(15),name varchar2(20),
salary number(9,2));

Whether it will work or returns error? post answer with
explanation.

Answer Posted / nilesh

It will not work,

If u have data in a table and u have to change data type
number to varchar2 then it will gives error, If u change
varchar2(100) column to char(200) it will work,
The number to varchar2 or varchar2 to number will not work
when u have data in table.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which data type is a composite type?

530


Can we write ddl statements in functions?

564


Can we rollback truncate?

537


what are the advantages and disadvantages of cascading style sheets? : Sql dba

547


How can you save or place your msg in a table?

521






What are predefined functions in sql?

531


How to add, remove, modify users using sql?

558


What is fmtonly in sql?

527


How do you bind variables in pl sql?

578


What is sql analyzer?

539


What are the sql aggregate functions?

604


how mysql optimizes distinct? : Sql dba

549


Is natural join and inner join same?

492


- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?

1384


What is a rank in sql?

536