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

how to increment dates by 1 in mysql? : Sql dba

542


What is the difference between left outer join and left join?

517


Do ddl statements need commit?

540


What are the string functions in sql?

530


Can we create table in function?

574






What is a relationship and what are they?

582


Is sql easier than java?

527


what is error ora-03113: end-of-file on communication channel?

607


What is the use of procedures?

546


What are the different parts of a package?

635


what is text? : Sql dba

564


What are the types of join in sql?

520


What is sql used for?

647


ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..

2010


Is sqlite good enough for production?

535