update user u set u.username='小花' where u.id='1';
update user u set u.username='小明' where u.id='2';
update user u set u.username='小李' where u.id='3';
update user u set u.username='小王' where u.id='4;
......
类似这样的操作。
目前我的解决方案是这样的
begin
update user u set u.username='小花' where u.id='1';
update user u set u.username='小明' where u.id='2';
update user u set u.username='小李' where u.id='3';
update user u set u.username='小王' where u.id='4;
......;
end;
<update id="batchUpdate" parameterClass="list">
begin
<iterate conjunction="">
update user u set u.username=#[].username# where u.id=#[].id#;
</iterate>
end;
</update>
declare
i number;
j number;
begin
i := 1;
j := 0;
select count(*) into j from T1;
loop
exit when i > j;
update T1 set T1.Subobject_Name = (select T2.Subobject_Name from T2 where T1.ID = T2.ID)
where T1.ID >= i and T1.ID <= (i + 1000);
i := i + 1000;
commit;
end loop;
end;
declare
i number;
j number;
begin
i := 1;
j := 0;
select count(*) into j from T1;
loop
exit when i > j;
update T1 set T1.Subobject_Name = (select T2.Subobject_Name from T2 where T1.ID = T2.ID)
where T1.ID >= i and T1.ID <= (i + 1000);
i := i + 1000;
commit;
end loop;
end;