Oracle 5.0 Reference Manual page 794

Table of Contents

Advertisement

Examples:
SELECT _latin1 x'AABBCC';
SELECT _latin1 0xAABBCC;
SELECT _latin1 b'1100011';
SELECT _latin1 0b1100011;
MySQL determines a literal's character set and collation in the following manner:
• If both
and
_X
COLLATE Y
• If
is specified but
_X
see the default collation for each character set, use the
• Otherwise, the character set and collation given by the
collation_connection
Examples:
• A string with
latin1
SELECT _latin1'Müller' COLLATE latin1_german1_ci;
• A string with
latin1
SELECT _latin1'Müller';
• A string with the connection default character set and collation:
SELECT 'Müller';
Character set introducers and the
specifications.
An introducer indicates the character set for the following string, but does not change now how the
parser performs escape processing within the string. Escapes are always interpreted by the parser
according to the character set given by
The following examples show that escape processing occurs using
character_set_connection
(which changes
SET NAMES
"Connection Character Sets and
function so that the exact string contents can be seen.
Example 1:
mysql>
SET NAMES latin1;
Query OK, 0 rows affected (0.01 sec)
mysql>
SELECT HEX('à\n'), HEX(_sjis'à\n');
+------------+-----------------+
| HEX('à\n') | HEX(_sjis'à\n') |
+------------+-----------------+
| E00A
| E00A
+------------+-----------------+
1 row in set (0.00 sec)
Here, "à" (hex value E0) is followed by "\n", the escape sequence for newline. The escape sequence
is interpreted using the
newline (hex value 0A). This happens even for the second string. That is, the introducer of
not affect the parser's escape processing.
Example 2:
mysql>
SET NAMES sjis;
Specifying Character Sets and Collations
are specified, character set
is not specified, character set
COLLATE
[443]
system variables are used.
character set and
latin1_german1_ci
character set and its default collation (that is, latin1_swedish_ci):
clause are implemented according to standard SQL
COLLATE
character_set_connection
[442]
even in the presence of an introducer. The examples use
character_set_connection
Collations"), and display the resulting strings using the
|
character_set_connection
774
and collation
are used.
X
Y
and its default collation are used. To
X
statement.
SHOW COLLATION
character_set_connection
collation:
[442].
[442], as discussed in
[442]
value of
latin1
[442]
and
Section 10.1.4,
[889]
HEX()
to produce a literal
does
_sjis

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents