db2里有类似sleep的过程或函数吗?

db2里有类似sleep的过程或函数吗?显示全部
db2里有类似sleep的过程或函数吗?收起
参与3

返回atpeace331的回答

atpeace331atpeace331数据库管理员银行

DB2 里有类似 sleep的存储过程,但是得 DB2 v9.7以后版本,而且官方文档也没公开。
下面是会话睡眠暂挂 3秒 的示例

db2 " CALL DBMS_ALERT.SLEEP(3) "

v9.7之前,使用存储过程实现吧,我给您提供个示例:

create procedure test.sleep (in sleeptime integer)

begin

declare wait_until timestamp;
set wait_until = (current timestamp + sleeptime seconds);
while (wait_until > current timestamp)
do
end while;

end
银行 · 2020-09-16
浏览1431

回答者

atpeace331
数据库管理员银行

atpeace331 最近回答过的问题

回答状态

  • 发布时间:2020-09-16
  • 关注会员:1 人
  • 回答浏览:1431
  • X社区推广