This is the Official Handbook for MARIADB: The translation of SET variable.
Original:https://mariadb.com/kb/en/set-variable/
I submit it to MARIADB official manual:https://mariadb.com/kb/zh-cn/set-variable/
Grammar
SET var_name = expr [, var_name = expr] ...
The statements in the stored program stored programs SET
are an extended function of the normal SET statement. Variable reference, you can refer to the stored program internal, global system variables, or user-defined variables.
The statements in the stored program SET
are implemented as part of the existing SET syntax. This allows extended SET a = x,b = y,...
syntax, where you can mix different variable types (locally declared variables, global system variables, and session system variables, user-defined variables). Also allows the combination of local variables and some options that make sense only for system variables; In this case, although the option is recognized, it is ignored.
SET
You can assign values to local variables locally variables and user-defined variables user-defined variables .
When you assign values to multiple variables by using the column values returned by the query, you should prioritize using SELECTinto.
When assigning the same value to multiple variables, you can use the function last_value ().
The following is an example of an assignment of a user-defined variable:
SET @x = 1;Example of a translator supplement: set assigns values to multiple types of variables, noting that when one of the variables fails, the entire statement fails set @x = 1, SESSION sql_mode = " ; SET GLOBAL sort_buffer_size = 1000000, SESSION sort_buffer_size = 1000000; SET @@ Global sort_buffer_size = 1000000, @@ Global. Sort_buffer_size = 1000000; SET GLOBAL max_connections = sort_buffer_size = 1000000;
Back to Linux series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.html
Back to Site Architecture series article outline: http://www.cnblogs.com/f-ck-need-u/p/7576137.html
Back to Database series article outline: http://www.cnblogs.com/f-ck-need-u/p/7586194.html
Reprint Please specify source: http://www.cnblogs.com/f-ck-need-u/p/8620767.html
Note: If you think this article is not bad please click on the lower right corner of the recommendation, your support can inspire the author more enthusiasm for writing, thank you very much!
Translation: SET Variable (submitted to MARIADB official manual)