SQL怎么实现SLEEP功能
答案:2 悬赏:0 手机版
解决时间 2021-01-24 09:47
- 提问者网友:皆是孤独
- 2021-01-23 09:48
SQL怎么实现SLEEP功能
最佳答案
- 五星知识达人网友:怀裏藏嬌
- 2021-01-23 11:22
sql实现sleep功能,可以参考如下代码:
declare
start_time date;
cur_time date;
begin
dbms_output.put_line('please input interval time:');
select sysdate,sysdate into start_time,cur_time from dual;
while (cur_time-start_time<=(&t/86400))
loop
select sysdate into cur_time from dual;
end loop;
dbms_output.put_line('start time is '||to_char(start_time,'yyyy-mm-dd
hh24:mi:ss')||', end time is '|| to_char(cur_time,'yyyy-mm-dd
hh24:mi:ss'));
end;
declare
start_time date;
cur_time date;
begin
dbms_output.put_line('please input interval time:');
select sysdate,sysdate into start_time,cur_time from dual;
while (cur_time-start_time<=(&t/86400))
loop
select sysdate into cur_time from dual;
end loop;
dbms_output.put_line('start time is '||to_char(start_time,'yyyy-mm-dd
hh24:mi:ss')||', end time is '|| to_char(cur_time,'yyyy-mm-dd
hh24:mi:ss'));
end;
全部回答
- 1楼网友:蕴藏春秋
- 2021-01-23 12:55
sql可以利用插件实现sleep功能
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯