Contents Index VALIDATE TABLE statement WHENEVER statement [ESQL]

ASA SQL Reference
  SQL Statements

WAITFOR statement


Description 

Use this statement to delay processing for the current connection for a specified amount of time or until a given time.

Syntax 

WAITFOR { DELAY time | TIME time }

time:  string

Usage 

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.

Permissions 

None

Side effects 

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).

See also 

CREATE EVENT statement

Standards and compatibility 
Examples 

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'

Contents Index VALIDATE TABLE statement WHENEVER statement [ESQL]