Oracle 5.0 Reference Manual page 766

Table of Contents

Advertisement

A binary string is a string of bytes that has no character set or collation. A nonbinary string is a string of
characters that has a character set and collation. For both types of strings, comparisons are based on
the numeric values of the string unit. For binary strings, the unit is the byte. For nonbinary strings the
unit is the character and some character sets support multi-byte characters. Character value ordering is
a function of the string collation.
String literals may have an optional character set introducer and
[_charset_name]'string' [COLLATE collation_name]
Examples:
SELECT _latin1'string';
SELECT _latin1'string' COLLATE latin1_danish_ci;
You can use
N'literal'
statements are equivalent:
SELECT N'some text';
SELECT n'some text';
SELECT _utf8'some text';
For more information about these forms of string syntax, see
Character Set and
Collation", and
Within a string, certain sequences have special meaning unless the
SQL mode is enabled. Each of these sequences begins with a backslash ("\"), known as the escape
character. MySQL recognizes the escape sequences shown in
Sequences". For all other escape sequences, backslash is ignored. That is, the escaped character is
interpreted as if it was not escaped. For example, "\x" is just "x". These sequences are case sensitive.
For example, "\b" is interpreted as a backspace, but "\B" is interpreted as "B". Escape processing is
done according to the character set indicated by the
variable. This is true even for strings that are preceded by an introducer that indicates a different
character set, as discussed in
Table 9.1. Special Character Escape Sequences
Escape
Character Represented by Sequence
Sequence
An ASCII NUL (0x00) character.
\0
A single quote ("'") character.
\'
A double quote (""") character.
\"
A backspace character.
\b
A newline (linefeed) character.
\n
A carriage return character.
\r
A tab character.
\t
ASCII 26 (Control+Z). See note following the table.
\Z
A backslash ("\") character.
\\
A "%" character. See note following the table.
\%
A "_" character. See note following the table.
\_
The ASCII 26 character can be encoded as "\Z" to enable you to work around the problem that ASCII
26 stands for END-OF-FILE on Windows. ASCII 26 within a file causes problems if you try to use
mysql db_name <
file_name.
The "\%" and "\_" sequences are used to search for literal instances of "%" and "_" in pattern-matching
contexts where they would otherwise be interpreted as wildcard characters. See the description of the
String Literals
(or n'literal') to create a string in the national character set. These
Section 10.1.3.6, "National Character
Section 10.1.3.5, "Character String Literal Character Set and
746
clause:
COLLATE
Section 10.1.3.5, "Character String Literal
Set".
NO_BACKSLASH_ESCAPES
Table 9.1, "Special Character Escape
character_set_connection
[537]
[442]
system
Collation".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents