ALTER SESSION Statement¶
Virtual DataPort includes an statement that allows users to update session properties.
The syntax of the command is the following:
ALTER SESSION SET <property:literal> = <value:literal>
To restore some property to its default value:
ALTER SESSION SET <property:literal> = NULL
At the moment, this statement only allows to set the property querytimeout
, which allows users to
specify the default query timeout for VQL queries. That is, the maximum time (in milliseconds) the Server
will wait for a VQL command to finish. After this period, the Server will cancel the command.
ALTER SESSION SET 'querytimeout' = '10000'
All the clients that connect to Virtual DataPort via JDBC or ODBC establish a default timeout for queries.
This statement allows to override the query timeout specified by the client application for all later queries
in the user session. A value of 0
implies “unrestricted” execution time (see note below).
It is possible to query the current session querytimeout
using the GETSESSION
function:
SELECT GETSESSION('querytimeout') FROM DUAL()
In addition, you can change the timeout for a single query by adding the parameter 'QUERYTIMEOUT' = '<value>'
to the CONTEXT
clause of the query. See more about this in the section CONTEXT Clause of the VQL Guide.
Note
In addition to the querytimeout
, VQL commands may be affected by other types of timeouts like
transaction timeouts or the thread timeout. So a VQL command can be aborted by the VDP server before
the query timeout expires even if the query timeout is set to 0
(unrestricted). The Resource Manager
can also impose limits to the query timeout.