我要写一个存储过程,在该过程中要提交一些JOB,利用JOB中的程序完成一些任务。
而且只能等所有 的任务完成,才能往后继续执行。因为任务完成会有一些标志,所以我打算根据这些标志控制该过程,但是ORACLE有什么函数可以等待呢。
我要实现的逻辑是:
LOOP
得到任务是否完成标志;
IF 任务完成 THEN
EXIT;
ELSE
等待(?怎么实现?)
END;
END LOOP;
做其他事情;
我想ORACLE应该有这样的函数,哪位大哥提示一下,谢谢!
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