Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to delay a sql statement in PL/SQL block
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
![]() |
![]() |