db2语句块示例

1.注意事项

在DB2COPY上执行,需要设置语句终止符号:"@"或者";"或者"/".

 

2.while 语句块

begin
declare count int default 1;
while (count<=100) do
  insert into test values(count, 'aaa'||count, 'qqq', 'www');
  update test set c3='aaa',c4='sss'  where c1 = count and c2 = 'aaa'||count;
commit;
set count=count+1;
end while;
end
@

 

3.for

begin

 4.IF

IF i mod 1000 = 0 then

commit;

ENDIF;

 

posted @ 2021-07-02 11:47  疾风泣影  阅读(214)  评论(0编辑  收藏  举报