----Oracle某表某字段存在空值,如何将其属性强制为“非空"?---- RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先把空值的更新为非空,然后加这个 not null 限制。 查询得到非空?用NVL(字段,非空值) 什么意思?如果要将该字段加上非空约束SQL> create table tttt as select 1 id,2 num from dual 2 union all select 2,null from dual; Table created SQL> alter table tttt modify num not null; alter table tttt modify num not null ORA-02296: 无法启用 (W.) - 找到空值 SQL> alter table tttt modify num not null enable novalidate; Table altered SQL> insert into tttt values(3,null); insert into tttt values(3,null) ORA-01400: 无法将 NULL 插入 ("W"."TTTT"."NUM") alter table tttt modify num not null enable novalidate;使用这个命令表示对历史数据没有影响,但是以后的数据会有影响的。 请问EXCEL如何访问ORACLE并更新数据 imp 导入的问题? 安装错误,急!在线等待。 修改字符集 IT综合技术交流群(15557577)现急需软件开发方面高手加盟助阵 oracle 长连接多久超时? 关于在linux下定期自动备份ORACLE的问题? Oracle操作 如何登陆到oracle manager server 上 建视图 到底要怎么跟蹤oracle執行的語句啊? oracle中如何选出固定年的每个月的天数
用NVL(字段,非空值)
2 union all select 2,null from dual;
Table created
SQL> alter table tttt modify num not null;
alter table tttt modify num not null
ORA-02296: 无法启用 (W.) - 找到空值
SQL> alter table tttt modify num not null enable novalidate;
Table altered
SQL> insert into tttt values(3,null);
insert into tttt values(3,null)
ORA-01400: 无法将 NULL 插入 ("W"."TTTT"."NUM")