Re: How to delay a sql statement in PL/SQL block

From: Scott Urman <surman_at_dlsun338.us.oracle.com>
Date: 1996/11/07
Message-ID: <55ti1t$49u_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <55t5pe$583_at_nntp1.u.washington.edu>, lesliet_at_u.washington.edu (L. Tseng) writes:
|> I'd like to do the following:
|>
|> LOOP
|>
|> delay 5 seconds;
|>
|> select...;
|> delete ...;
|> update...;
|> END LOOP;
|>
|> Does anyone know how to implement this? I noticed 'DELAY'
|> is a reserved word in PL/SQL but could not find any info
|> about it. Is this the right one to use and how?

Use DBMS_LOCK.SLEEP. It takes the number of seconds to sleep as an argument. You can specify a resolution down to 1/100th of a second.

|> Thanks,
|>
|> Leslie



Scott Urman Oracle Corporation surman_at_us.oracle.com

Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2 Published by Oracle Press - http://www.osborne.com/oracle/index.htm

"The opinions expressed here are my own, and are not necessarily that of  Oracle Corporation"
Received on Thu Nov 07 1996 - 00:00:00 CET

Original text of this message