Question: How do I use the
dbms_lock.sleep procedure? Can you give an
example script using dbms_lock.sleep?
Answer: The dbms_lock.sleep
procedure directs a PL/SQL anonymous code snippet or stored
procedure (or function) to stop for a specified period of n
Here is an example of using dbms_lock.sleep in PL/SQL:
The slow_function.sql script below
creates an artificially slow function by using the
dbms_lock.sleep procedure to sleep for 20 seconds. For this
to work successfully the user must be granted execute
permission on the dbms_lock package.
CREATE OR REPLACE FUNCTION slow_function (p_number IN
RETURN BOOLEAN AS
Mimic a slow function.