[Oracle] [命令] 修改字段类型
2007-03-22 16:37
495 查看
Oracle provides "alter table" syntax to modify data columns in-place in this form:
alter table
table_name
modify
column_name datatype;
If you are brave you can use a single "alter table" syntax to modify multiple columns:
alter table
table_name
modify
(
column1_name column1_datatype,
column2_name column2_datatype,
column3_name column3_datatype,
column4_name column4_datatype
);
Here are some examples of Oracle "alter table" syntax to modify data columns and note that you can add constraints like NOT NULL:
ALTER TABLE
customer
MODIFY
(
cust_name varchar2(100) not null,
cust_hair_color varchar2(20)
)
;
ALTER TABLE t_yms_template MODIFY ( REQST_START_MOTH null);
We can also use Oracle "alter table" syntax in dynamic PL/SQL to modify data columns
BEGIN
SQL_STRING := 'ALTER TABLE '||:TABLE_NAME||' MODIFY '||:COLUMN_NAME||' VARCHAR2(100';
. . .
END;
相关文章推荐
- oracle修改字段类型时报"要更改的列必须为空"处理方法
- oracle怎样修改表名、列名、字段类型、添加表列、删除表列
- oracle 修改某个字段的数据类型三种方式
- Oracle 修改带数据的字段类型
- Oracle修改字段类型方法总结
- Oracle修改字段类型方法总结
- Oracle修改字段类型方法总结
- oracle 修改字段类型的方法(转)
- ORACLE修改字段类型
- Oracle 修改字段类型
- 修改Oracle 字段类型
- Oracle 修改字段类型和长度
- Oracle修改字段顺序和字段类型以及拼接字段,查看锁表
- Oracle修改字段类型方法总结
- Oracle修改字段类型方法总结
- Oracle 修改数据库字段的类型的语句
- 如何修改oracle字段类型
- Oracle修改字段类型方法总结
- 详解Oracle修改字段类型方法总结
- Oracle 修改表名 列名 字段类型 语句