In SQL, a character string is any sequence of zero or more alphanumeric characters that belong to a given Character set. A Character set is a named character repertoire that includes a Form-of-use encoding scheme which defines how the repertoire's characters are encoded as numbers. The SQL Standard defines several standard Character sets that your DBMS must support. A character string value may be a <literal>, an <identifier>, the value of a parameter or a host language variable or the result of any expression or argument that evaluates to a character string. All character strings belong to some Character set and are governed by the rules of some Collation during comparisons. A Collation is a named collating sequence. Character strings that belong to the same Character set are compatible.
A character string has a length: a non-negative integer equal to the number of
characters in the string. Characters in a character string are numbered (from
left to right), beginning with 1. A Character string also has a coercibility
attribute; this helps your DBMS determine which Collation to use for a
comparison that doesn't provide an explicit COLLATE clause.
The coercibility attribute can be either COERCIBLE,
EXPLICIT, IMPLICIT or NO
COLLATION. (A coercibility attribute of COERCIBLE,
EXPLICIT or IMPLICIT means the string has
a current default Collation. A coercibility attribute of
NO COLLATION means the string does not have a current
default Collation.) Character strings are stored in either of the six character
string <data type>s: CHARACTER,
CHARACTER VARYING,
CHARACTER LARGE OBJECT,
NATIONAL CHARACTER,
NATIONAL CHARACTER VARYING or
NATIONAL CHARACTER LARGE OBJECT.
-
Character String <literal>s
An SQL <character string literal> has five parts: Its value: the sequence o... -
Character String <data type>s
A character string <data type> is defined by a descriptor that contains fiv... -
Character String Operations
A character string is compatible with, and comparable to, all other charac... -
Character Strings and Character Sets
[Obscure Rule] applies for this entire section. In the last chapter, we mad... -
Character Strings and Collations
[Obscure Rule] applies for this entire section. A Collation, or collating s... -
Dialects
The "typical" SQL DBMS supports most of the standard character data types, ... -
Table 7.1
Collating Sequences and Coercibility Rules for Monadic Operations <<style c... -
Table 7.2
Collating Sequences and Coercibility Rules for Dyadic Operations <<style cl... -
Table 7.3
Collating Sequences used for Comparisons <<style class="underheader-lines">...