SET and SET SESSION
On this page
Sets a session variable.
Warning
SingleStore recommends using the SET SESSION statement for session variables that are only referenced by the aggregator nodes on which the variable is set.
Syntax
SET [SESSION] variable_name = value;SET @@SESSION.variable_name = value;
Arguments
-
variable_: Name of the session variable to configure.name -
value: The session variable's value.
Remarks
-
The
SESSIONkeyword is optional.Including it does not change this command’s behavior. -
The
@@SESSION.syntax is supported for compatibility with other database systems, such as MySQL.variable_ name -
This command can be run on a Master or Child aggregator node to set sync variables, but otherwise must be run on the Master Aggregator.
-
Refer to Engine Variables for information on other ways to set variables.
-
SET PASSWORDsets the user password.Refer to SET PASSWORD topic for details.
Warning
SET NAMES, SET CHARSET, and SET CHARACTER SET are non-operational in SingleStore.
Examples
The following queries set the value of the session variable net_ to 5000.
SET net_read_timeout = 5000;SET @@SESSION.net_read_timeout = 5000;
The following query retrieves the value of the session variable net_.
SELECT @@net_read_timeout;
Refer to Assigning Expressions to Variables for more examples.
Related Topics
Last modified: