Translation: SET Variable (submitted to the MariaDB official Manual), variablemariadb

Source: Internet
Author: User

Translation: SET Variable (submitted to the MariaDB official Manual), variablemariadb

This article is the official mariadb Manual: the translation of SET Variable.

Original article: https://mariadb.com/kb/en/set-variable/
Https://mariadb.com/kb/zh-cn/set-variable/ I submitted to the MariaDB official manual

Syntax
SET var_name = expr [, var_name = expr] ...

In stored programsSETA statement is an extension of a Common SET statement. When a variable is referenced, it can reference a stored program, a global system variable, or a user-defined variable.

InSETStatements are implemented as part of the existing SET syntax. This allows expansionSET a = x,b = y,...Syntax, where different variable types can be mixed (local declared variables, global system variables and session system variables, User-Defined variables ). You can also combine local variables and some options that are meaningful only to system variables. In this case, although the options are identified, they are ignored.

SETYou can assign values to local variables and user-defined variables.

When assigning values to multiple variables by querying the returned column values, select into should be given priority.

You can use the LAST_VALUE () function to assign the same value to multiple variables ().

The following is an example of user-defined variable assignment:

SET @ x = 1; // The translator adds an example: SET assigns values to multiple types of variables. Note that when one of the variables fails to assign values, 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, @ local. sort_buffer_size = 1000000; set global max_connections = 1000, sort_buffer_size = 1000000;

 

Back to Linux series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.html
Back to website 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
Reprinted please indicate the source: http://www.cnblogs.com/f-ck-need-u/p/8620767.html

Note: If you think this article is not bad, please click the recommendation in the lower right corner. Your support can stimulate the author's enthusiasm for writing. Thank you very much!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.