ASA SQL Reference
SQL Statements
Use this statement to delay processing for the current connection for a specified amount of time or until a given time.
WAITFOR { DELAY time | TIME time }
time: string
If DELAY is used, processing is suspended for the given interval. If TIME is specified, processing is suspended until the server time reaches the time specified.
If the current server time is greater than the time specified, processing is suspended until that time on the following day.
WAITFOR provides an alternative to the following statement, and may be useful for customers who choose not to license Java in the database:
call java.lang.Thread.sleep( <time_to_wait_in_millisecs> )
In many cases, scheduled events are a better choice than using WAITFOR TIME, because scheduled events execute on their own connection.
None
The implementation of this statement uses a worker thread while it is waiting. This uses up one of the threads specified by the -gn database option (the default is 20 threads).
SQL/92 Vendor extension.
SQL/99 Vendor extension.
Sybase This statement is also implemented by Adaptive Server Enterprise.
The following example waits for three seconds:
WAITFOR DELAY '00:00:03'
The following example waits for 0.5 seconds (500 milliseconds):
WAITFOR DELAY '00:00:00:500'
The following example waits until 8 PM:
WAITFOR TIME '20:00'