Home » SQL & PL/SQL » SQL & PL/SQL » How to wait for a condition and timeout?
How to wait for a condition and timeout? [message #196668] Fri, 06 October 2006 08:01 Go to next message
123soleil
Messages: 35
Registered: July 2006
Member
Hello,

I have the following code

loop
select status into l_status from k.status where id = 210;
exit when l_status <> 'Processing';
end loop;


I'm basically waiting for my entry to go from 'processing' to 'done'. However, if the 'Done' status doesn't come say after 2 minutes, I would like my loop to stop.

How can I do this?

Thanks!
Re: How to wait for a condition and timeout? [message #196672 is a reply to message #196668] Fri, 06 October 2006 08:09 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
Use dbms_lock.sleep.
Re: How to wait for a condition and timeout? [message #196680 is a reply to message #196668] Fri, 06 October 2006 08:39 Go to previous message
123soleil
Messages: 35
Registered: July 2006
Member
great, thanks!
Previous Topic: sql*plus Report
Next Topic: Inserting dynamic values into a dynamic query.
Goto Forum:
  


Current Time: Mon Dec 02 08:01:26 CST 2024