直接执行则会报错ORA-01407如下:
SQL> update t_rm_subversioninfo a
2 set a.verid=(select t.pro_id from t_hwz t where t.pro_name=a.projectname )
3 ;
update t_rm_subversioninfo a
set a.verid=(select t.pro_id from t_hwz t where t.pro_name=a.projectname )
ORA-01407: 无法更新 ("CCRM"."T_RM_SUBVERSIONINFO"."VERID") 为 NULL但是已经确认了这样关联查询出来的结果是没有空值的:select t.pro_id from t_rm_subversioninfo a,
t_hwz t where t.pro_name=a.projectname将两张表在where后面做了exists关联,问题是解决了,可是为什么会这样,还是搞不清楚,麻烦大神们明示,多谢!
SQL>
SQL> update t_rm_subversioninfo a
2 set a.verid=(select t.pro_id from t_hwz t where t.pro_name=a.projectname )
3 where exists (select 1 from t_hwz t where t.pro_name=a.projectname);
34 rows updated
SQL> update ORA-01407空值
SQL> update t_rm_subversioninfo a
2 set a.verid=(select t.pro_id from t_hwz t where t.pro_name=a.projectname )
3 ;
update t_rm_subversioninfo a
set a.verid=(select t.pro_id from t_hwz t where t.pro_name=a.projectname )
ORA-01407: 无法更新 ("CCRM"."T_RM_SUBVERSIONINFO"."VERID") 为 NULL但是已经确认了这样关联查询出来的结果是没有空值的:select t.pro_id from t_rm_subversioninfo a,
t_hwz t where t.pro_name=a.projectname将两张表在where后面做了exists关联,问题是解决了,可是为什么会这样,还是搞不清楚,麻烦大神们明示,多谢!
SQL>
SQL> update t_rm_subversioninfo a
2 set a.verid=(select t.pro_id from t_hwz t where t.pro_name=a.projectname )
3 where exists (select 1 from t_hwz t where t.pro_name=a.projectname);
34 rows updated
SQL> update ORA-01407空值
解决方案 »
- 求sql语句
- 动态获得select的查询结果的列数
- oralce 9i 文本转换成数字 “无效数字”错误
- 两个分区表能做分区交换吗
- 在线等待,高分悬赏!高手请进!分不够再开贴!!!
- sql 导入orcal问题
- ORA-01855: 要求 AM/A.M. 或 PM/P.M.
- 请给个toad7.5.2的注册码或7.4的下栽地址啊~~
- win7 32位下 oracle 11g.执行shutdown immediate时直接关闭了,再连接该数据库时就卡住了,重启也是卡
- Java(thin)链接问题
- trigger调用procedure的最简单的问题。
- oracle9i以及oracle10G里面,一个新用户想浏览已建用户表的表结构,需要什么权限呢?
t_rm_subversioninfo 中 verid 不在 select t.pro_id from t_hwz t where t.pro_name=a.projectname 就会更新为null值啊,很好理解吧。。
恩,明白了。就是对于不匹配的行被更新为null没有反应过来