skip to main content
Reference : Supported SQL Statements and Extensions : Alter Session (EXT)
  

Try DataDirect Drivers Now

Alter Session (EXT)

Purpose

The Alter Session statement changes various attributes of a database session or a remote session. A database session maintains the state of the overall connection. A remote session maintains the state that pertains to a particular remote data source connection.

Syntax

ALTER SESSION SET attribute_name=value
where:
attribute_name
specifies the name of the attribute to be changed. Attributes apply to either database sessions or remote sessions.
value
refers to the specific value setting for that attribute.
The following table lists the database and remote session attributes, and provides their descriptions.
Table 17. Alter Session Attributes
Attribute Name
Session Type
Description
Current_Schema
Database
Sets the current schema for the database session. The current schema is the schema used when an identifier in a SQL statement is unqualified. The string value must be the name of a schema visible in the database session. For example:
ALTER SESSION SET CURRENT_SCHEMA=RIGHTNOW
Stmt_Call_Limit
Database
Sets the maximum number of Web service calls the driver can make when executing a statement. Setting the Stmt_Call_Limit attribute has the same effect as setting the StmtCallLimit connection option. It sets the default Web service call limit used by any statement on the connection. Executing this command on a statement overrides the previously set StmtCallLimit for the connection.
The value specified for this attribute can be -1, 0, or a positive integer:
If -1 is specified, the limit is the default value configured in the service when connected to a site whose version is August 2014 or later. When connected to a site whose version is prior to August 2014, the driver sets the maximum number of calls to 100.
If 0 is specified, the limit is the maximum number of calls allowed by the service when connected to sites whose version is August 2014 or later. For versions prior to August 2014, there is no limit.
For example, the following statement sets the statement call limit to 10 Web service calls:
ALTER SESSION SET STMT_CALL_LIMIT=10
Note: If you specify a value that is greater than the maximum value allowed by the service when connecting to a site whose version is August 2014 or later, the driver returns a warning indicating that it will use the service defined maximum instead of the value specified.
Ws_Call_Count
Remote
Resets the Web service call count of a remote session to the value specified. The value must be zero or a positive integer. WS_Call_Count represents the total number of Web service calls made to the remote data source instance for the current session. For example:
ALTER SESSION SET servicecloud.WS_CALL_COUNT=0
The current value of WS_Call_Count can be obtained by referring to the System_Remote_Sessions system table. For example:
SELECT * FROM
information_schema.system_remote_sessions
WHERE session_id = cursessionid()