title: How can I create a while loop if a query goes over 10 minutes execution then it exits
body: <p>This is the actual query, so the refresh starts and then finishes usually in 30 seconds or less but now and then gets stuck.  I want it to end if it has elapsed more than 10 minutes.</p>
  
  <pre><code>select 'Refresh started: '||to_char(sysdate,'DD-Mon-YYYY hh24:mi:ss') from      
  dual;
  DECLARE
    temp integer;
  BEGIN
    temp := DBMS_DEFER_SYS.PUSH (
                       destination =&gt; 'some address',
                       stop_on_error =&gt; FALSE,
                       delay_seconds =&gt; 0,
                       parallelism =&gt; 0);
  end;
  /
  select 'Refresh Ended: '|| to_char(sysdate, 'DD-Mon-YYYY hh24:mi:ss') from     
  dual;
  disc
  </code></pre>
  
  <p>It then continues on to the next query similar to the one above but connecting somewhere else.</p>
  
  <p>Thanks in advance!</p>