SET OPTION

Enables you to set OpenESQL options.

Syntax:

>>---EXEC SQL---SET OPTION----.-QUERYTIME---.----------.-->
                              +-LOGINTIME---+
                              +-APPLICATION-+
                              +-HOST--------+
                              +-DATE--------+-USA------+
                                            +-EUR------+
                                            +-JIS------+
                                            +-ODBC-----+
                                            +-EXTERNAL-+
                                            +-ISO------+
                                            +-DEFAULT--+
                              +-TIME--------+-USA------+
                                            +-EUR------+
                                            +-JIS------+
                                            +-ODBC-----+
                                            +-EXTERNAL-+
                                            +-ISO------+
                                            +-DEFAULT--+
                               +-DATEDELIM--+-char-----+ 
                               +-TIMEDELIM--+-char-----+
                               +-TSTAMPSEP--+-char-----+
                               +-DETECTDATE-+-CLIENT---+
                                            +-SERVER---+
                                            +-OFF------+ 

 >---value---END-EXEC---><

Parameters:

value A literal or the name of a host variable. The host variable must contain character values for APPLICATION or HOST and numeric values for LOGINTIME or QUERYTIME.
QUERYTIME Sets the number of seconds that the program waits for a response to an OpenESQL statement. The default is 0, meaning forever. This option does not override existing network timeout settings.
LOGINTIME Sets the number of seconds that the program waits for a response to a CONNECT TO statement. The default is 10 seconds. A value of 0 indicates an infinite timeout period.
APPLICATION Sets the application name which is passed by OpenESQL to the data source when a CONNECT TO statement is executed.
HOST Sets the host workstation name which is passed by OpenESQL when a CONNECT TO statement is executed.
Note: For a full description of the DATE, TIME, DATEDELIM, TIMEDELIM, TSTAMPSEP, and DETECTDATE options and their corresponding parameters, see the equivalent SQL Compiler Directive Options topic as listed in the Related reference section below.

Comment:

The SET OPTION statement is not supported by all ODBC drivers.

As an option, you can place an equals (=) sign between an option and its parameter. For example, the following are equivalent:
exec sql set option date EUR end-exec
and
exec sql set option date=EUR end-exec

Example:

     EXEC SQL SET OPTION logintime 5 END-EXEC

     EXEC SQL CONNECT TO "srv2" USER "sa." END-EXEC

* If the CONNECT statement cannot log in to the server "srv2"
* within five seconds, it will time out and return to the program.

     EXEC SQL SET OPTION querytime 2 END-EXEC

     EXEC SQL SELECT name FROM sysobjects INTO :name END-EXEC

* If the SELECT statement does not respond within 2 seconds,
* the query will time out and return to the program.