SET PRO_CONNECT QUERY_TIMEOUT
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
SET PRO_CONNECT QUERY_TIMEOUT
Defines the maximum number of seconds during which a query should execute for the current SQL Server connection.
Syntax
|
Parameter
- n
-
Indicates the maximum number of seconds during which a query should execute before it is automatically cancelled by the SQL server. Setting the value of n to
0disables a previously set query timeout.
Notes
- Both database and non-database administrators can execute this command. The value specified by n applies only to current SQL connection and is in effect for the duration of the current connection.
- Timeout value can be cleared by specifying a value of 0 on subsequent execution of the
statement
SET PRO_CONNECT QUERY_TIMEOUT 0. - To enable timeout at server level use the
PRO_SERVERstatement,SET PRO_SERVER QUERY_TIMEOUT n - When both the Server and connection timeouts are set, the lower of the timeout values takes the precedence.
- To set timeout when working with JDBC and ODBC clients, execute the
SET PRO_SERVER/CONNECTstatement before executing the SQL statements. - Timeout is applicable to only SELECT statements. Other DDL and DML statements are not cancelled by SQL server when they exceed the specified timeout value.
- Timeout accounts only the query execution time i.e., the time it takes to prepare, execute and fetch the results. It does not account the time the clients take to stream the data.
Example
This
example sets the query timeout to 30 seconds:
|