Special character handling during MySQL data warehouse receiving _ MySQL

Source: Internet
Author: User
Detailed explanation of special character processing during MySQL data warehouse receiving

In a string, if a sequence has a special meaning, each sequence starts with a backslash ("") and is called an escape character. MySQL recognizes the following escape characters:

0
An ASCII 0 (NUL) character.
'
It is a string of 39 ASCII single quotes.
"
An ASCII 34 double quotation mark ("") character.

An ASCII 8 return character.
An ASCII 10 line break.
R
An ASCII 13 carriage return.
T
An ASCII 9 TAB ).
Z
ASCII (26) (Control-Z ). In Windows, ASCII (26) represents the end of a file. (ASCII (26) may cause problems when mysql database <filename is used .)
An ASCII 92 backslash ("") character.
%
An ASCII 37 "%" character. It is used to search for the text instance of "%" in the body. otherwise, "%" is interpreted as a wildcard.
_
An ASCII 95 '_' character. It is used to search for the text instance of "_" in the body. otherwise, "_" is interpreted as a wildcard.
Note that if "%" or "_" is used in some body environments, strings "%" and "_" are returned instead of "%" and "_".

Strings that contain quotation marks can be written in the following ways:

A string is referenced by a single quotation mark ('). The single quotation mark (') character in the string can be escaped by a single quotation mark.

A string is referenced by double quotation marks (""). The character "" in this string can be escaped.

You can also add an escape character "" before the quotation marks to escape.

A string is referenced by double quotation marks (""). The single quotation marks (') in the string do not need to be treated specially and do not need to be repeated or escaped. Similarly, if a string is referenced by single quotation marks ('), the double quotation marks ("") in the string do not need to be treated specially and do not need to be repeated or escaped.

The following SELECT statement demonstrates how quotes and escaping work:

Mysql> SELECT 'hello', '"hello"', '"hello" "', 'hello', 'Hello'

BitsCN.com

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.