title: Sleep function in ORACLE
body: <p>I need execute an SQL query in ORACLE it takes a certain amount of time. 
  So I wrote this function:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION MYSCHEMA.TEST_SLEEP
  (
  TIME_  IN  NUMBER
  )
  RETURN INTEGER IS
   BEGIN
     DBMS_LOCK.sleep(seconds =&gt; TIME_);
  RETURN 1;
   EXCEPTION
     WHEN OTHERS THEN
     RAISE;
     RETURN 1;
  END TEST_SLEEP;
  </code></pre>
  
  <p>and I call in this way</p>
  
  <pre><code>SELECT TEST_SLEEP(10.5) FROM DUAL
  </code></pre>
  
  <p>but to work I need set grant of <code>DBMS_LOCK</code> to the owner of the procedure.</p>
  
  <p>How I can rewrite this function without using  the <code>DBMS_LOCK.sleep</code> function?</p>