Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 44242 invoked from network); 8 Apr 2010 19:13:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Apr 2010 19:13:22 -0000 Received: (qmail 43625 invoked by uid 500); 8 Apr 2010 19:13:22 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 43598 invoked by uid 500); 8 Apr 2010 19:13:21 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 43591 invoked by uid 99); 8 Apr 2010 19:13:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Apr 2010 19:13:21 +0000 X-ASF-Spam-Status: No, hits=-1500.6 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Apr 2010 19:13:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2575523888EC; Thu, 8 Apr 2010 19:13:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r932066 - in /db/derby/docs/trunk/src: devguide/cdevcollation.dita devguide/tdevdvlpcollation.dita ref/rrefattribcollation.dita Date: Thu, 08 Apr 2010 19:13:00 -0000 To: derby-commits@db.apache.org From: chaase3@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100408191300.2575523888EC@eris.apache.org> Author: chaase3 Date: Thu Apr 8 19:12:59 2010 New Revision: 932066 URL: http://svn.apache.org/viewvc?rev=932066&view=rev Log: DERBY-4591: Documentation needed for global case-insensitive setting (DERBY-1748) Modified 2 topics in Dev Guide and one in Ref Manual. Patch: DERBY-4591.diff Modified: db/derby/docs/trunk/src/devguide/cdevcollation.dita db/derby/docs/trunk/src/devguide/tdevdvlpcollation.dita db/derby/docs/trunk/src/ref/rrefattribcollation.dita Modified: db/derby/docs/trunk/src/devguide/cdevcollation.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/devguide/cdevcollation.dita?rev=932066&r1=932065&r2=932066&view=diff ============================================================================== --- db/derby/docs/trunk/src/devguide/cdevcollation.dita (original) +++ db/derby/docs/trunk/src/devguide/cdevcollation.dita Thu Apr 8 19:12:59 2010 @@ -105,7 +105,7 @@ is not set. To determin

Collation examples

With Unicode codepoint collation (UCS_BASIC), the numerical values of the Unicode encoding of the characters -is used directly for ordering. For example, the FRUIT table contains the NAME +are used directly for ordering. For example, the FRUIT table contains the NAME column that uses the VARCHAR(20) data type. The contents of the NAME column are: orange @@ -122,7 +122,7 @@ case letters. The statement SELE Pineapple

If the database is created with the territory attribute set to en_US (English language, United States country code), and the collation attribute -set to TERRITORY_BASED , the results of the statement SELECT * FROM +set to TERRITORY_BASED, the results of the statement SELECT * FROM FRUIT ORDER BY NAME returns: apple Banana @@ -131,18 +131,22 @@ FRUIT ORDER BY NAME returns: Pineapple

The collation set for the database also impacts comparison operators on character data types. For example, the statement SELECT * FROM -FRUIT WHERE NAME > Banana returns: UCS_BASIC collation Territory-based collation +FRUIT WHERE NAME > 'Banana' ORDER BY NAME returns: + UCS_BASIC collation Territory-based collation Grape Grape Pineapple orange - Pineapple

+ Pineapple

+

For information on creating case-insensitive databases, see +.

+
Differences between LIKE and equal (=) comparisons

When you use territory-based collation, the comparisons -can return different results when you use the LIKE and equal +can return different results when you use the LIKE and equal (=) operators. For example, suppose that the database is set to use a territory where the character 'z' has same collation elements as 'xy'. Consider the following two WHERE clauses:

  1. WHERE 'zcb' = 'xycb'
  2. -
  3. WHERE 'zcb' LIKE 'xy_b
  4. +
  5. WHERE 'zcb' LIKE 'xy_b'

For WHERE clause 1, returns TRUE because the collation elements for the entire string 'zcb' will match the collation elements of the entire string 'xycb'.

For WHERE clause Modified: db/derby/docs/trunk/src/devguide/tdevdvlpcollation.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/devguide/tdevdvlpcollation.dita?rev=932066&r1=932065&r2=932066&view=diff ============================================================================== --- db/derby/docs/trunk/src/devguide/tdevdvlpcollation.dita (original) +++ db/derby/docs/trunk/src/devguide/tdevdvlpcollation.dita Thu Apr 8 19:12:59 2010 @@ -28,7 +28,7 @@ when you create the database.collation territory-based -.

You can use the collation and territory attributes +

You can use the collation and territory attributes to specify territory-based collation. This type of collation applies only to user-defined tables. The system tables use the Unicode codepoint collation.

The collation attribute can be specified @@ -41,5 +41,25 @@ and the TERRITORY_BASED value for the

For example:

jdbc:derby:MexicanDB;create=true;territory=es_MX;collation=TERRITORY_BASED
+Creating a case-insensitive database +

The collation value TERRITORY_BASED uses the default +collation strength for the locale, usually TERTIARY, which will consider +character case significant in searches and comparisons. To make the database +use case-insensitive searches, specify an explicit strength with the +collation attribute. The strength name is appended to +TERRITORY_BASED with a colon to separate them.

+

For example:

+jdbc:derby:SwedishDB;create=true;territory=sv_SE;collation=TERRITORY_BASED:PRIMARY +

With strength PRIMARY, the characters 'A' and 'a' will be considered equal, +as well as 'a' with no accent and 'a' with a grave accent. (This behavior is +commonly the default with many other databases.) To make searches +respect differences in accent, use strength SECONDARY.

+

The exact interpretation of the strength part of the attribute depends upon +the locale.

+

For more information, see + and the documentation of +the collation attribute in the +.

+
Modified: db/derby/docs/trunk/src/ref/rrefattribcollation.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefattribcollation.dita?rev=932066&r1=932065&r2=932066&view=diff ============================================================================== --- db/derby/docs/trunk/src/ref/rrefattribcollation.dita (original) +++ db/derby/docs/trunk/src/ref/rrefattribcollation.dita Thu Apr 8 19:12:59 2010 @@ -30,27 +30,61 @@ limitations under the License.
Function

The collation attribute is an optional attribute that specifies whether collation is based on the territory specified for the database or Unicode codepoint collation. The valid -values for the collation attribute are: TERRITORY_BASED and -UCS_BASIC. The default collation is Unicode codepoint collation (UCS_BASIC).

collation attribute are:

+
+ +
UCS_BASIC
+
Unicode codepoint collation. This value is the default.
+
+ +
TERRITORY_BASED
+
Based on the language specified with the territory attribute. The default +collation strength for the locale is used. The default for + is commonly TERTIARY, +in which character case is significant in searches and comparisons.
+
+ +
TERRITORY_BASED:PRIMARY
+
Territory based with collation strength PRIMARY. Specify this value to make + behave similarly to +many other databases, for which PRIMARY is commonly the default.
+
+ +
TERRITORY_BASED:SECONDARY
+
Territory based with collation strength SECONDARY.
+
+ +
TERRITORY_BASED:TERTIARY
+
Territory based with collation strength TERTIARY.
+
+ +
TERRITORY_BASED:IDENTICAL
+
Territory based with collation strength IDENTICAL.
+
+
+The collation attribute can be specified only when you create a database. You cannot specify this attribute on an existing -database or when you upgrade a database.

If you include the collation attribute -with the value TERRITORY_BASED when you create the database, -the collation is based on the language and country codes that you specify +database or when you upgrade a database. +

If you specify the collation attribute with the value +TERRITORY_BASED, or one of its variants with a specific collation strength, the +collation is based on the language and country codes that you specify with the territory attribute.

If you do not specify the territory attribute when you create the database, uses the java.util.Locale.getDefault method to determine the current value of the default locale for this instance of the Java Virtual Machine (JVM).

The collation attribute applies only to user-defined tables. The system tables use the Unicode codepoint -collation.
+collation.
+

For information on how + handles collation, see +"Creating a database with territory-based collation" and "Character-based +collation in " in the +.

Example

The following example shows the URL to create the MexicanDB database. The territory attribute specifies Spanish for the language code and Mexico for the country code. The collation attribute specifies that the collation for the database is territory based.

jdbc:derby:MexicanDB;create=true;territory=es_MX;collation=TERRITORY_BASED
-
For information on how handles -collation, see "Character-based collation in " -in the