Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to delay the execution of an SQL statement?
I think dbms_lock.sleep (or user_lock.sleep)
have already been mentioned, and these
are accurate to 0.01 seconds. (Although one
takes its input in seconds and the other in
hundredths).
You do have to be careful about procedures that sleep and poll though - you can get caught by KGL (internal) locks if you need to recompile them or things they are dependent on. Make sure you have an even that makes them shut themselves down.
An alternative to the 'waiting cheaply' for a user event is the dbms_alert package. Your waiter could register an interest in an alert, then wait on it. Your other process could then raise an alert when it does the critical event. This may be cleaner than writing your own mechanism.
-- Jonathan Lewis http://www.jlcomp.demon.co.uk Author of: Practical Oracle 8i: Building Efficient Databases Next Seminar - Australia - July/August http://www.jlcomp.demon.co.uk/seminar.html Host to The Co-Operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html FC wrote in message ...Received on Thu May 02 2002 - 09:16:03 CDT
>
>Well,
>I have a similar question, I'd like to make a stored procedure enter into a
>"stand-by" state without consuming too much CPU time.
>Say for instance I am looping waiting for a user triggered event, how can I
>doze for half a second and then wake up again ?
>
>
![]() |
![]() |