Oracle alter table modify column Syntax example
2012-01-17 13:45
274 查看
http://dba-oracle.com/t_alter_table_modify_column_syntax_example.htm
For complete tips on Oracle alter table syntax, see the book "Easy Oracle Jumpstart".
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)
)
;
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;
For complete tips on Oracle alter table syntax, see the book "Easy Oracle Jumpstart".
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)
)
;
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 alter table add column example
- MySQL ALTER TABLE: ALTER vs CHANGE vs MODIFY COLUMN 2014-07-03 14:13:11
- MySQL ALTER TABLE: ALTER COLUMN vs CHANGE COLUMN vs MODIFY COLUMN
- MySQL ALTER TABLE: ALTER vs CHANGE vs MODIFY COLUMN
- MySQL ALTER TABLE: ALTER vs CHANGE vs MODIFY COLUMN
- alter table fx.pet modify column `species` varchar(20) binary;
- MySQL ALTER TABLE: ALTER vs CHANGE vs MODIFY COLUMN
- 备忘:Alter Table中: ALTER vs CHANGE vs MODIFY COLUMN 区别
- ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
- alter table t_apsg_items alter column remark varchar(2000)
- MySQL ALTER TABLE: ALTER vs CHANGE vs MODIFY COLUMN
- 由于一个或多个对象访问此列,ALTER TABLE DROP COLUMN *** 失败。
- oracle分区表之交换分区 altertable exchange partition with table
- create [table,column],alter column use SMO
- Oracle XMLTable Tutorial With Example
- alter table image alter column id int IDENTITY (1, 1) NOT NULL 帮我看看语句是否正确!!
- oracle ALTER TABLE MOVE 索引失效
- [Hive - LanguageManual] Alter Table/Partition/Column
- mysql ALTER COLUMN MODIFY COLUMN CHANGE COLUMN 区别及用法 (转)
- oracle:表、列、约束等操作,table,constraint,column