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.
Yong Huang
So there is no single command like 'wait' or 'timeout' or simple things like that?
> Yong Huang
You could also use OS command inside sql*plus, e.g., on UNIX:
sqlplus user/passwd
select * from tab1;
host sleep 60
select * from tab2
quit
will sleep for 60 secodns between first and second select
Prem
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
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