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

 

上一篇:SQL查询:如何将IN()转换为JOIN?


下一篇:java – DB2 jdbc性能