Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how to 'wait' in SQL plus

Re: how to 'wait' in SQL plus

From: Mark Bole <makbo_at_pacbell.net>
Date: Fri, 13 Aug 2004 03:29:20 GMT
Message-ID: <kAWSc.3979$Rk7.3779@newssvr27.news.prodigy.com>


Alan wrote:

> yong321_at_yahoo.com (Yong Huang) wrote in message news:<b3cb12d6.0408121100.26cab210_at_posting.google.com>...
> 

>>"zeb" <spam_at_nowhere.com> wrote in message news:<411a6933$0$26984$626a14ce_at_news.free.fr>...
>>
>>>>What's the Oracle SQLPlus command to 'wait' for a particular period of
>>>>time (e.g. 10 seconds) before the next statement/command run?
>>>
>>>see dbms_lock.sleep
>>>HTH
>>
>>Just for the record. (Credit to Jonathan Lewis) dbms_lock.sleep has a
>>small error in case you need it to be accurate. When you
>>dbms_lock.sleep(1000), it really sleeps 1024 seconds (if I remember
>>right). I just did a test on my 9.0.1 database running on Windows
>>2000, sleep(100) took 104 seconds. But my measurement is not very
>>scientific.
>>
>>Also, if you use 8i, read Metalink Note:187528.1 for errors when sleep
>>time exceeds 4164 seconds.
>>
> 
> 
> 
> So there is no single command like 'wait' or 'timeout' or simple things like that?
> 

>>Yong Huang

Yes, it is very simple, one single command, as reading the documentation for the suggestion above would show:

SQL> select to_char(sysdate, 'HH24:MI') from dual;

TO_CH



20:25

SQL> exec DBMS_LOCK.SLEEP(120);

PL/SQL procedure successfully completed.

SQL> select to_char(sysdate, 'HH24:MI') from dual;

TO_CH



20:27

--Mark Bole Received on Thu Aug 12 2004 - 22:29:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US