求助

[复制链接]
查看11 | 回复4 | 2010-10-8 09:32:25 | 显示全部楼层 |阅读模式
我要写一个存储过程,在该过程中要提交一些JOB,利用JOB中的程序完成一些任务。
而且只能等所有 的任务完成,才能往后继续执行。因为任务完成会有一些标志,所以我打算根据这些标志控制该过程,但是ORACLE有什么函数可以等待呢。
我要实现的逻辑是:
LOOP
得到任务是否完成标志;
IF 任务完成 THEN

EXIT;
ELSE

等待(?怎么实现?)
END;
END LOOP;
做其他事情;
我想ORACLE应该有这样的函数,哪位大哥提示一下,谢谢!
回复

使用道具 举报

千问 | 2010-10-8 09:32:25 | 显示全部楼层
sleep
回复

使用道具 举报

千问 | 2010-10-8 09:32:25 | 显示全部楼层
SLEEP Procedure
This procedure suspends the session for a given period of time.
Syntax
DBMS_LOCK.SLEEP (
secondsIN NUMBER);
Parameters
Table 53-11 SLEEP Procedure Parameters
Parameter Description
seconds Amount of time, in seconds, to suspend the session.
The smallest increment can be entered in hundredths of a second; for example, 1.95 is a legal time value
回复

使用道具 举报

千问 | 2010-10-8 09:32:25 | 显示全部楼层
谢谢 cyr1974
回复

使用道具 举报

千问 | 2010-10-8 09:32:25 | 显示全部楼层
LOOP
data_gathering_procedure;

DBMS_LOCK.sleep(10); -- do nothing for 10 seconds
END LOOP;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行