oracle 现有表A 其中字段a为空值 我现在需要一个存储过程把字段的的值设置为0 并且没10000条记录提交一次

[复制链接]
查看11 | 回复2 | 2013-3-22 13:07:51 | 显示全部楼层 |阅读模式
declarev_count number;beginv_count := 0;
for cur_data in (select t.id form table_name t where t.column is null) loop
update table_name t set t.column = 0 where t.id = cur_data.id;
v_count := v_count + 1;
if v_count > 0 and mod(v_count, 10000) = 0 then
commit;
v_coun...
回复

使用道具 举报

千问 | 2013-3-22 13:07:51 | 显示全部楼层
用存储过程吗?update 表A set a=0 where a is null where rownum<=10000;commit; 多执行几次不就是你要的效果吗...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行