Oracle 5.0 Reference Manual page 793

Table of Contents

Advertisement

The character set and collation are specified for the column, so they are used. The column has
character set
• If
CHARACTER SET X
used.
CREATE TABLE t1
(
col1 CHAR(10) CHARACTER SET utf8
) CHARACTER SET latin1 COLLATE latin1_bin;
The character set is specified for the column, but the collation is not. The column has character set
and the default collation for utf8, which is utf8_general_ci. To see the default collation for
utf8
each character set, use the
• If
COLLATE Y
collation
Y
CREATE TABLE t1
(
col1 CHAR(10) COLLATE utf8_polish_ci
) CHARACTER SET latin1 COLLATE latin1_bin;
The collation is specified for the column, but the character set is not. The column has collation
utf8_polish_ci
• Otherwise, the table character set and collation are used.
CREATE TABLE t1
(
col1 CHAR(10)
) CHARACTER SET latin1 COLLATE latin1_bin;
Neither the character set nor collation are specified for the column, so the table defaults are used.
The column has character set
The
CHARACTER SET
If you use
ALTER TABLE
map the data values, but if the character sets are incompatible, there may be data loss.
10.1.3.5. Character String Literal Character Set and Collation
Every character string literal has a character set and a collation.
A character string literal may have an optional character set introducer and
[_charset_name]'string' [COLLATE collation_name]
Examples:
SELECT 'string';
SELECT _latin1'string';
SELECT _latin1'string' COLLATE latin1_danish_ci;
For the simple statement
the
character_set_connection
The
_charset_name
about to follow uses character set X." Because this has confused people in the past, we emphasize that
an introducer does not change the string to the introducer character set like
do. It does not change the string's value, although padding may occur. The introducer is just a signal.
An introducer is also legal before standard hex literal and numeric hex literal notation
and 0xnnnn), or before bit-field literal notation
Specifying Character Sets and Collations
and collation utf8_unicode_ci.
utf8
is specified without COLLATE, character set
SHOW COLLATION
is specified without
are used.
and the character set is the one associated with the collation, which is utf8.
latin1
and
COLLATE
to convert a column from one character set to another, MySQL attempts to
'string', the string has the character set and collation defined by
SELECT
expression is formally called an introducer. It tells the parser, "the string that is
statement.
SET, the character set associated with
CHARACTER
and collation latin1_bin.
clauses are standard SQL.
[442]
and
collation_connection
(b'literal'
773
and its default collation are
X
COLLATE
[443]
system variables.
CONVERT()
and 0bnnnn).
and
Y
clause:
[948]
would
(x'literal'

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents