Oracle 5.0 Reference Manual page 795

Table of Contents

Advertisement

Query OK, 0 rows affected (0.00 sec)
mysql>
SELECT HEX('à\n'), HEX(_latin1'à\n');
+------------+-------------------+
| HEX('à\n') | HEX(_latin1'à\n') |
+------------+-------------------+
| E05C6E
+------------+-------------------+
1 row in set (0.04 sec)
Here,
character_set_connection
followed by "\" (hex values
string are interpreted as a single
The following "n" (hex value 6E) is not interpreted as part of an escape sequence. This is true even for
the second string; the introducer of
10.1.3.6. National Character Set
Standard SQL defines
some predefined character set. MySQL 5.0 uses
these data type declarations are equivalent:
CHAR(10) CHARACTER SET utf8
NATIONAL CHARACTER(10)
NCHAR(10)
As are these:
VARCHAR(10) CHARACTER SET utf8
NATIONAL VARCHAR(10)
NCHAR VARCHAR(10)
NATIONAL CHARACTER VARYING(10)
NATIONAL CHAR VARYING(10)
You can use
statements are equivalent:
SELECT N'some text';
SELECT n'some text';
SELECT _utf8'some text';
For information on upgrading character sets to MySQL 5.0 from versions prior to 4.1, see the MySQL
3.23, 4.0, 4.1 Reference Manual.
10.1.3.7. Examples of Character Set and Collation Assignment
The following examples show how MySQL determines default character set and collation values.
Example 1: Table and Column Definition
CREATE TABLE t1
(
c1 CHAR(10) CHARACTER SET latin1 COLLATE latin1_german1_ci
) DEFAULT CHARACTER SET latin2 COLLATE latin2_bin;
Here we have a column with a
definition is explicit, so that is straightforward. Notice that there is no problem with storing a
column in a
Example 2: Table and Column Definition
CREATE TABLE t1
(
c1 CHAR(10) CHARACTER SET latin1
) DEFAULT CHARACTER SET latin1 COLLATE latin1_danish_ci;
Specifying Character Sets and Collations
| E05C6E
and 5C) is a valid multi-byte character. Hence, the first two bytes of the
05
sjis
or
NCHAR
NATIONAL CHAR
(or n'literal') to create a string in the national character set. These
N'literal'
latin1
table.
latin2
|
[442]
is sjis, a character set in which the sequence of "à"
character, and the "\" is not interpreted as an escape character.
does not affect escape processing.
_latin1
as a way to indicate that a
as this predefined character set. For example,
utf8
character set and a
775
CHAR
latin1_german1_ci
column should use
collation. The
latin1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents