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: Yong Huang <yong321_at_yahoo.com>
Date: 13 Aug 2004 07:18:31 -0700
Message-ID: <b3cb12d6.0408130618.4ae70610@posting.google.com>


desertflowerln_at_yahoo.com (Alan) wrote in message news:<b1217045.0408121535.2c75133_at_posting.google.com>...
> 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

As Prem pointed out, you could temporarily exit to the UNIX shell (or DOS) and run the sleep command there. There're many sleep.exe or timeout.exe implementations on the Internet. Just make sure the command is in your PATH. But it's just as easy to type exec dbms_lock.sleep(10) at SQLPLUS> prompt. And you can use this in PL/SQL too (just drop exec).

Yong Huang Received on Fri Aug 13 2004 - 09:18:31 CDT

Original text of this message

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