如何修改列的大小 [英] how to modify the size of a column

查看:63
本文介绍了如何修改列的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Oracle SQL Developer中创建了表Test_Project2.之后,我意识到proj_name列的大小很小,因此我决定使用follwoing语句修改该列

I created the table Test_Project2 in Oracle SQL Developer. After that I realized that the column proj_name is of a small size, so I decided to modify the column using the follwoing statement

ALTER TABLE TEST_PROJECT2 MODIFY proj_name VARCHAR2(300);

但是由于某种原因,Oracle SQL Developer用红色强调了分号,我不知道什么是错误以及如何纠正它

but for some reason Oracle SQL Developer underscores the semi-colon with red and I do not what is mistake and how to correct it

Test_Project2 :

CREATE TABLE Test_Project2 (
proj_id number(30),
proj_name VARCHAR2 (30),
proj_desc VARCHAR2(300)
);

推荐答案

无论Oracle SQL Developer在语法高亮显示中可能指示什么错误,实际上都按照最初具有完美效果的方式运行alter语句:

Regardless of what error Oracle SQL Developer may indicate in the syntax highlighting, actually running your alter statement exactly the way you originally had it works perfectly:

ALTER TABLE TEST_PROJECT2 MODIFY proj_name VARCHAR2(300);

仅当需要一次更改多个列时,才需要添加括号,例如:

You only need to add parenthesis if you need to alter more than one column at once, such as:

ALTER TABLE TEST_PROJECT2 MODIFY (proj_name VARCHAR2(400), proj_desc VARCHAR2(400));

这篇关于如何修改列的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆