您的位置:首页 > 其它

ORA-01407 错误解决

2010-02-16 16:27 162 查看
from:http://www.raincat.net/blog/showlog.asp?cat_id=6&log_id=428

示例:

SQL> update tb_test_log a
2 set game_deal_log_id = (select game_deal_log_id
3 from test b
4 where a.table_id = b.table_id);

上述多表联合更新时,有时会报“ORA-01407: cannot update to null”错误,原因系存在表间关联不到的记录(null)。

解决方法:

SQL> update tb_test_log a
2 set game_deal_log_id = (select game_deal_log_id
3 from test b
4 where a.table_id = b.table_id)
5 where exists (select 1 from test b where a.table_id=b.table_id);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: