Richard,
Some of the standard syntax definitions for the collate clauses are:
Table column definition
<column definition> ::=
<column name>
{ <data type> | <domain name> }
[ <reference scope check> ]
[ <default clause> ]
[ <column constraint definition>... ]
[ <collate clause> ]
A string expression
<string value expression> ::=
<character value expression>
| <bit value expression>
| <blob value expression>
<character value expression> ::=
<concatenation>
| <character factor>
<concatenation> ::=
<character value expression> <concatenation operator> <character factor>
<character factor> ::=
<character primary> [ <collate clause> ]
<character primary> ::=
<value expression primary>
| <string value function>
The collate clause:
<collate clause> ::= COLLATE <collation name>
The details about the use of collations is in section 4.2.3 "Rules
determining collating sequence usage". I have copied that section from a
pdf below (note the tables have been copied as graphics to preserve the
layout, I hope they make it through):
4.2.3 Rules determining collating sequence usage
The rules determining collating sequence usage for character strings are
based on the following:
— Expressions where no columns are involved (e.g., literals, host
variables) are by default compared
using the default collating sequence for their character repertoire.
NOTE 3 – The default collating sequence for a character repertoire is
defined in Subclause 10.6,
‘‘<character set specification>’’, and Subclause 11.30, ‘‘<character set
definition>’’.
— When one or more columns are involved (e.g., comparing two columns, or
comparing a column to
a literal), then provided that all columns involved have the same
default collating sequence and
there is no explicit specification of a collating sequence, that default
collating sequence is used.
— When columns are involved having different default collating
sequences, explicit specification of
the collating sequence in the expression is required via the <collate
clause>.
— Any explicit specification of collating sequence in an expression
overrides any default collating
sequence.
To formalize this, <character value expression>s effectively have a
coercibility characteristic. This
characteristic has the values Coercible, Implicit, No collating
sequence, and Explicit. <character
value expression>s with the Coercible, Implicit, or Explicit
characteristics have a collating sequence.
A <character value expression> consisting of a column reference has the
coercibility characteristic
Implicit, with collating sequence as defined when the column was
created. A <character value
expression> consisting of a value other than a column (e.g., a host
variable or a literal) has the
coercibility characteristic Coercible, with the default collation for
its character repertoire. A <character
value expression> simply containing a <collate clause> has the
coercibility characteristic
Explicit, with the collating sequence specified in the <collate clause>.
For n-adic operations (e.g., <case expression>) with operands X1, X2, .
. . , Xn, the collating sequence
is effectively determined by considering X1 and X2, then combining this
result with X3, and so on.
HTH
Dennis Cote
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------