If your PL/SQL is within Forms 4.5, you can use TIMER to do this.
If not, just enter a loop within your PL/SQL block and keep selecting
to_char(sysdate,'SS') until the difference between first and last results
is equal to X and then exit the loop.
AER.
Chuck Hamilton wrote:
>
> Is there any way to tell PL/SQL to sleep for X seconds before
> proceeding to the next line of code?
> --
> Chuck Hamilton
> chu...@ix.netcom.com
>
> If at first you don't succeed, skydiving isn't for you.
--
_________________________________________________
Robert C. Nix
Oracle Tools Support
mailto:rn...@us.oracle.com
The thoughts, opinions, remarks, statements, ...
expressed here are my own and do not necessarily
represent those of Oracle Corporation.
Not that I have been able to find explicitly, but you can fake it
by putting in a for loop, which has nothing (except a Null) in it.
Some experimentation would be necessary to do the timing.
Actually, how about writing a procedure containig a while loop
that checks sysdate constantly - high overhead, but would work...
If done inside Forms, then you could have a timer running for X seconds,
and constantly check if it is still running (use find_timer)
I'm not aware of any built-in etc that will do it for you, and I have looked.
HIH
Lee
----------------+---------------------------------------------------
This | Lee Levy, ISSD Systems Development, Del Code (34)
space | BHP Information Technology, ACN 006 476 213
left blank | PO Box 261, Warrawong, NSW 2502, Australia
intentionally | PH: +61 42 75-5485 Fax: -5500 Tie: 8855-
in mourning | Internet : levy....@bhp.com.au
----------------+---------------------------------------------------
Opinions expressed are mostly my own, so give me some credit.
I vaguely remember something about timers ...
HEY! WAKE UP!
Oracle 7 Server Application Developers Guide, pag. A-14
dbms_lock.sleep(seconds)
I like that book very much, one keeps learning new things.
Why do you need it, does your program run too fast?
--
Kind reGards
\ / |
X |
/ \ s
Gerard
DBMS_UTILITY.SLEEP(X);
should do the job
Regards, Klaus
--
Klaus Eichler | Haus 2, 3C7.1 | email ek2...@m30x.nbg.scn.de
Siemens AG, AUT 652 | Moorenbrunn |
Postfach 4848 | Gleiwitzer Str. 555 | Tel +49 911 895-2918
D-90327 Nuernberg | D-90475 Nuernberg | Fax +49 911 895-4802
You can use the dbms_lock.slep(nn) where nn is the time in seconds
to force the execution to sleep.
Hope this helps.
--
Vikram Goel Motorola email: vg...@pts.mot.com
Sr. Oracle DBA - Consultant
Aerotek Inc. My email: vg...@emi.net
Motorola Info:
Mail Stop 39, Room S1014
1500 Gateway Blvd,
Boynton Beach, FL 33426
>If not, just enter a loop within your PL/SQL block and keep selecting
>to_char(sysdate,'SS') until the difference between first and last results
>is equal to X and then exit the loop.
The DBMS sleep call is best. The first thing I'd do when tuning a problem
system is look for these loops, both in the 3gl and the SQL. During peak
loads they'll eat your CPU down, while I/O is cool. Call your hibernate
routine in the 3gl.
-Austin