I want to introduce sleep time for my already stored procedure. Can you please let me know the syntax for that like where to place it in my procedure. I want to use DBMS_LOCK.sleep(time in seconds).
Asked
Active
Viewed 3,923 times
-1
-
Hello. Welcome to Stack Overflow. Please have a look around and take the [tour], and read through the [help center]. You can also read about [ask] a good question. – Sampada Apr 25 '16 at 09:51
-
Hope this link help you... http://stackoverflow.com/questions/2561671/sleep-function-in-oracle – Trushna Apr 25 '16 at 09:58
-
No Trushna, that is not giving me the information required. – Satender Dalal Apr 25 '16 at 10:00
-
This is the [official oracle 12c doc on dbms_lock.sleep](https://docs.oracle.com/database/121/ARPLS/d_lock.htm#ARPLS66782). – collapsar Apr 25 '16 at 10:10
-
If you can provide the code snippet it will be easy for us to comment/answer – Avrajit Roy Apr 26 '16 at 09:10
1 Answers
1
If i understand your question correctly you need the implementation of dbms_lock.sleep in your procedure. Basic idea of SLEEP Procedure is snooze the logic for mentioned seconds. so you can refer below snippet. Hope it helps.
BEGIN
FOR I IN (
/*YOUR SELECT QUERY */
)
LOOP
--Your processing logic
dbms_lock.SLEEP(10);
END LOOP;
END;

Avrajit Roy
- 3,233
- 1
- 13
- 25