SET Variable in MariaDB
The SET statement in MariaDB is used to set values to variables under the session. The variables declared by SET remain in the session unless modified, reset, or unset explicitly. These variables can store a variety of types of data such as integers, strings, etc, and even more complex data structures.
Syntax:
SET @variable_name = value;
- @variable_name: This is the name of the variable to be specified. It should obey the logical name identifier conventions in MariaDB.
- value: The value to be the variable. Can be a constant, an expression, or a function result.
Note: In MariaDB, the “@” symbol is used to denote user-defined variables.
SET Variable in MariaDB
In MariaDB, the SET statement is a main tool in variable handling. Users can assign values to variables, operate with them, and control database operations in various respects. This article includes a look at the SET variable usage in MariaDB and its syntax together with some examples.
Contact Us