1

I have created a table with column id as varchar2(20). Now I want to modify it and change size to 13 i.e column id varchar2(13). How to achieve it? Thanks in advance

p.s.: I don`t have any data in my table.

4

2 回答 2

2

You may try this for Oracle:-

alter table tablename modify 
( 
   column_name    varchar2(13)
);

Also If you dont have any data in the table then you can also drop the table and then create the table with the columname as varchar2(13)

于 2013-10-27T18:49:48.177 回答
-1

Just run this query for MySQL:

ALTER TABLE tablename CHANGE column `id` varchar2(13);

See here for more details. If you have additional constraints on this column, specify those as well.

于 2013-10-27T18:51:52.657 回答