增加列:alter table 表名 add(列名 数据类型);
修改列:alter table 表名 modify(列名 新的数据类型);
删除列:alter table 表名 drop column 列名;
修改列:alter table 表名 modify(列名 新的数据类型);
删除列:alter table 表名 drop column 列名;
解决方案 »
- win7下 oracle 11g安装心路历程.....
- 请大家帮忙看下哈
- 大侠们。。。如何给oracle的一个字段进行加密和解密。。?
- 透明网关访问SqlServer语句问题
- Linux系统下怎样创建oracle日志,以及如何查询?
- Oracle如何在SQL里求两个数的和
- 好急人,我的ORACLE存储过程要计算8个小时,共计5万条记录,帮我看看,慢在哪里?
- 利用prepareCall执行数据库存储过程时,如何接受多个输出参数?
- 怎样得到一个表的字段定义?
- pl SQL登陆问题 新手求大神指点!!!!
- 一个触发器问题,高分求解
- 用网络蚂蚁在ORACLR的网站下载,下载前两个没问题,为什么下载第三个总提示SetEndOfFile(112)的错误,然后下载中断?
alter table 表名 change 旧项名 新项名;更改表中某一项的名
alter table 表名 modify 项名 类型;更改表中某一项的类型
s 为表 nametable 里的一个字段
pk NUMBER PRIMARY KEY,
fk NUMBER,
c1 NUMBER,
c2 NUMBER,
CONSTRAINT ri FOREIGN KEY (fk) REFERENCES t1,
CONSTRAINT ck1 CHECK (pk > 0 and c1 > 0),
CONSTRAINT ck2 CHECK (c2 > 0)
);
An error will be returned for the following statements:/* The next two statements return errors:
ALTER TABLE t1 DROP (pk); -- pk is a parent key
ALTER TABLE t1 DROP (c1); -- c1 is referenced by multicolumn
-- constraint ck1
Submitting the following statement drops column pk, the primary key constraint, the foreign key constraint, ri, and the check constraint, ck1:ALTER TABLE t1 DROP (pk) CASCADE CONSTRAINTS;
If all columns referenced by the constraints defined on the dropped columns are also dropped, then CASCADE CONSTRAINTS is not required. For example, assuming that no other referential constraints from other tables refer to column pk, then it is valid to submit the following statement without the CASCADE CONSTRAINTS clause:ALTER TABLE t1 DROP (pk, fk, c1);