You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ch...@apache.org on 2013/08/27 19:49:58 UTC
svn commit: r1517897 - in /db/derby/docs/trunk/src:
devguide/cdevcollationattribs.dita devguide/cdevcollationexamples.dita
devguide/derbydev.ditamap ref/rrefattrib56769.dita ref/rrefsqlj20937.dita
ref/rrefsqlj58560.dita
Author: chaase3
Date: Tue Aug 27 17:49:58 2013
New Revision: 1517897
URL: http://svn.apache.org/r1517897
Log:
DERBY-4629 Explicitly document how to get case-insensitive sorts and comparisons of string data
Split a Developer's Guide topic into 2 and updated map file; modified 3 Reference Manual topics.
Patch: DERBY-4629.diff
Added:
db/derby/docs/trunk/src/devguide/cdevcollationexamples.dita (with props)
Modified:
db/derby/docs/trunk/src/devguide/cdevcollationattribs.dita
db/derby/docs/trunk/src/devguide/derbydev.ditamap
db/derby/docs/trunk/src/ref/rrefattrib56769.dita
db/derby/docs/trunk/src/ref/rrefsqlj20937.dita
db/derby/docs/trunk/src/ref/rrefsqlj58560.dita
Modified: db/derby/docs/trunk/src/devguide/cdevcollationattribs.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/devguide/cdevcollationattribs.dita?rev=1517897&r1=1517896&r2=1517897&view=diff
==============================================================================
--- db/derby/docs/trunk/src/devguide/cdevcollationattribs.dita (original)
+++ db/derby/docs/trunk/src/devguide/cdevcollationattribs.dita Tue Aug 27 17:49:58 2013
@@ -73,65 +73,7 @@ that only differences in base letters ar
</row>
</tbody>
</tgroup>
-</table></section>
-<section><title>Collation examples</title><p>With Unicode codepoint collation
-(UCS_BASIC), the numeric values of the Unicode encoding of the characters
-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:<sl>
-<sli>orange</sli>
-<sli>apple</sli>
-<sli>Banana</sli>
-<sli>Pineapple</sli>
-<sli>Grape</sli>
-</sl></p><p>UCS_BASIC collation sorts all uppercase letters before lowercase
-letters. The statement <codeph>SELECT * FROM FRUIT ORDER BY NAME</codeph>
-returns the following: <sl>
-<sli>Banana</sli>
-<sli>Grape</sli>
-<sli>Pineapple</sli>
-<sli>apple</sli>
-<sli>orange</sli>
-</sl></p>
-<p>The above result also appears if you specify <i>territory=ll_CC</i> but do
-not specify <i>collation=collation</i>.</p>
-<p>If the database is created with the <i>territory=ll_CC</i> attribute
-set to <i>en_US</i> (English language, United States country code) and the
-<i>collation=collation</i> attribute set to TERRITORY_BASED, the statement
-<codeph>SELECT * FROM FRUIT ORDER BY NAME</codeph> returns: <sl>
-<sli>apple</sli>
-<sli>Banana</sli>
-<sli>Grape</sli>
-<sli>orange</sli>
-<sli>Pineapple</sli>
-</sl></p>
-<p>The collation set for the database also impacts comparison operators
-on character data types. For example, the statement <codeph>SELECT * FROM
-FRUIT WHERE NAME > 'Banana' ORDER BY NAME</codeph> returns:</p>
-<simpletable frame="none">
-<sthead>
-<stentry>UCS_BASIC collation</stentry>
-<stentry>Locale-based collation</stentry>
-</sthead>
-<strow>
-<stentry>Grape</stentry>
-<stentry>Grape</stentry>
-</strow>
-<strow>
-<stentry>Pineapple</stentry>
-<stentry>orange</stentry>
-</strow>
-<strow>
-<stentry>apple</stentry>
-<stentry>Pineapple</stentry>
-</strow>
-<strow>
-<stentry>orange</stentry>
-<stentry> </stentry>
-</strow>
-</simpletable>
-<p>For information on creating case-insensitive databases, see
-<xref href="tdevdvlpcaseinscoll.dita#tdevdvlpcaseinscoll"></xref>.</p>
+</table>
</section>
</conbody>
</concept>
Added: db/derby/docs/trunk/src/devguide/cdevcollationexamples.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/devguide/cdevcollationexamples.dita?rev=1517897&view=auto
==============================================================================
--- db/derby/docs/trunk/src/devguide/cdevcollationexamples.dita (added)
+++ db/derby/docs/trunk/src/devguide/cdevcollationexamples.dita Tue Aug 27 17:49:58 2013
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
+ "../dtd/concept.dtd">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<concept id="cdevcollationexamples" xml:lang="en-us">
+<title>Examples of case-sensitive and case-insensitive string sorting</title>
+<shortdesc>These examples show the results of sorts on databases created
+with various collation and locale attributes.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>collation<indexterm>examples</indexterm></indexterm>
+<indexterm>locale-based collation<indexterm>examples</indexterm></indexterm>
+<indexterm>connection URL attributes<indexterm>examples of locale-based collation</indexterm></indexterm>
+</keywords>
+</metadata></prolog>
+<conbody>
+<section>
+<p>With Unicode codepoint collation (UCS_BASIC), the default if you do not
+specify either <i>collation=collation</i> or <i>territory=ll_CC</i>, the numeric
+values of the Unicode encoding of the characters 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:<sl>
+<sli>orange</sli>
+<sli>apple</sli>
+<sli>Banana</sli>
+<sli>Pineapple</sli>
+<sli>Grape</sli>
+</sl></p><p>UCS_BASIC collation sorts all uppercase letters before lowercase
+letters. The statement <codeph>SELECT * FROM FRUIT ORDER BY NAME</codeph>
+returns the following: <sl>
+<sli>Banana</sli>
+<sli>Grape</sli>
+<sli>Pineapple</sli>
+<sli>apple</sli>
+<sli>orange</sli>
+</sl></p>
+<p>The above result also appears if you specify <i>territory=ll_CC</i> but do
+not specify <i>collation=collation</i>.</p>
+<p>If the database is created with the <i>territory=ll_CC</i> attribute
+set to <i>en_US</i> (English language, United States country code) and the
+<i>collation=collation</i> attribute set to TERRITORY_BASED, the statement
+<codeph>SELECT * FROM FRUIT ORDER BY NAME</codeph> returns: <sl>
+<sli>apple</sli>
+<sli>Banana</sli>
+<sli>Grape</sli>
+<sli>orange</sli>
+<sli>Pineapple</sli>
+</sl></p>
+<p>The collation set for the database also impacts comparison operators
+on character data types. For example, the statement <codeph>SELECT * FROM
+FRUIT WHERE NAME > 'Banana' ORDER BY NAME</codeph> returns:</p>
+<simpletable frame="none">
+<sthead>
+<stentry>UCS_BASIC collation</stentry>
+<stentry>Locale-based collation</stentry>
+</sthead>
+<strow>
+<stentry>Grape</stentry>
+<stentry>Grape</stentry>
+</strow>
+<strow>
+<stentry>Pineapple</stentry>
+<stentry>orange</stentry>
+</strow>
+<strow>
+<stentry>apple</stentry>
+<stentry>Pineapple</stentry>
+</strow>
+<strow>
+<stentry>orange</stentry>
+<stentry> </stentry>
+</strow>
+</simpletable>
+<p>For information on creating case-insensitive databases, see
+<xref href="tdevdvlpcaseinscoll.dita#tdevdvlpcaseinscoll"></xref>.</p>
+</section>
+</conbody>
+</concept>
Propchange: db/derby/docs/trunk/src/devguide/cdevcollationexamples.dita
------------------------------------------------------------------------------
svn:eol-style = native
Modified: db/derby/docs/trunk/src/devguide/derbydev.ditamap
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/devguide/derbydev.ditamap?rev=1517897&r1=1517896&r2=1517897&view=diff
==============================================================================
--- db/derby/docs/trunk/src/devguide/derbydev.ditamap (original)
+++ db/derby/docs/trunk/src/devguide/derbydev.ditamap Tue Aug 27 17:49:58 2013
@@ -48,6 +48,7 @@ limitations under the License.
<relcell>
<topicref href="cdevcollationlocale.dita" navtitle="Locale-based collation"></topicref>
<topicref href="cdevcollationattribs.dita" navtitle="Database connection URL attributes that control collation"></topicref>
+<topicref href="cdevcollationexamples.dita" navtitle="Examples of case-sensitive and case-insensitive string sorting"></topicref>
<topicref href="cdevcollationlikeequal.dita" navtitle="Differences between LIKE and equal (=) comparisons"></topicref>
<topicref href="tdevdvlpcollation.dita" navtitle="Creating a database with locale-based collation"></topicref>
<topicref href="tdevdvlpcaseinscoll.dita" navtitle="Creating a case-insensitive database"></topicref>
@@ -60,6 +61,7 @@ limitations under the License.
</relcell>
<relcell>
<topicref href="cdevcollationattribs.dita" navtitle="Database connection URL attributes that control collation"></topicref>
+<topicref href="cdevcollationexamples.dita" navtitle="Examples of case-sensitive and case-insensitive string sorting"></topicref>
<topicref href="cdevcollationlikeequal.dita" navtitle="Differences between LIKE and equal (=) comparisons"></topicref>
<topicref href="tdevdvlpcollation.dita" navtitle="Creating a database with locale-based collation"></topicref>
<topicref href="tdevdvlpcaseinscoll.dita" navtitle="Creating a case-insensitive database"></topicref>
@@ -71,6 +73,18 @@ limitations under the License.
<topicref href="cdevcollationattribs.dita" navtitle="Database connection URL attributes that control collation"></topicref>
</relcell>
<relcell>
+<topicref href="cdevcollationexamples.dita" navtitle="Examples of case-sensitive and case-insensitive string sorting"></topicref>
+<topicref href="cdevcollationlikeequal.dita" navtitle="Differences between LIKE and equal (=) comparisons"></topicref>
+<topicref href="tdevdvlpcollation.dita" navtitle="Creating a database with locale-based collation"></topicref>
+<topicref href="tdevdvlpcaseinscoll.dita" navtitle="Creating a case-insensitive database"></topicref>
+<topicref href="tdevdvlpcustomcollation.dita" navtitle="Creating a customized collator"></topicref>
+</relcell>
+</relrow>
+<relrow>
+<relcell>
+<topicref href="cdevcollationexamples.dita" navtitle="Examples of case-sensitive and case-insensitive string sorting"></topicref>
+</relcell>
+<relcell>
<topicref href="cdevcollationlikeequal.dita" navtitle="Differences between LIKE and equal (=) comparisons"></topicref>
<topicref href="tdevdvlpcollation.dita" navtitle="Creating a database with locale-based collation"></topicref>
<topicref href="tdevdvlpcaseinscoll.dita" navtitle="Creating a case-insensitive database"></topicref>
@@ -2063,6 +2077,8 @@ with updatable result sets"></topicref>
</topicref>
<topicref href="cdevcollationattribs.dita" navtitle="Database connection URL attributes that control collation">
</topicref>
+<topicref href="cdevcollationexamples.dita" navtitle="Examples of case-sensitive and case-insensitive string sorting">
+</topicref>
<topicref href="cdevcollationlikeequal.dita" navtitle="Differences between LIKE and equal (=) comparisons">
</topicref>
</topicref>
Modified: db/derby/docs/trunk/src/ref/rrefattrib56769.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefattrib56769.dita?rev=1517897&r1=1517896&r2=1517897&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefattrib56769.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefattrib56769.dita Tue Aug 27 17:49:58 2013
@@ -123,7 +123,11 @@ and Mexican nationality.</p>
<xref href="rrefattribcollation.dita#rrefattribcollation">
<i>collation=collation</i></xref> attribute with
the <i>territory=ll_CC</i> attribute to specify that collation is based
-on the locale, instead of being based on Unicode codepoint collation</p>
+on the locale, instead of being based on Unicode codepoint collation. For more
+information, see "Creating a database with locale-based collation",
+"Creating a case-insensitive database", and "Character-based collation in
+<ph conref="../conrefs.dita#prod/productshortname"></ph>" in the
+<ph conref="../conrefs.dita#pub/citdevelop"></ph>.</p>
</section>
</refbody>
</reference>
Modified: db/derby/docs/trunk/src/ref/rrefsqlj20937.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj20937.dita?rev=1517897&r1=1517896&r2=1517897&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj20937.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj20937.dita Tue Aug 27 17:49:58 2013
@@ -56,7 +56,18 @@ the column name causes <ph conref="../co
use descending order for the column to create the index. Using the descending
order for a column can help improve the performance of queries that require
the results in mixed sort order or descending order and for queries that select
-the minimum or maximum value of an indexed column.</p><p>If a qualified index
+the minimum or maximum value of an indexed column.</p>
+<p>Sorting and ordering of character data is controlled by the collation
+specified for a database when it is created, as well as the locale of the
+database. For details, see
+<xref href="rrefattribcollation.dita#rrefattribcollation"><i>collation=collation</i> attribute</xref>
+and
+<xref href="rrefattrib56769.dita#rrefattrib56769"><i>territory=ll_CC</i> attribute</xref>,
+as well as the sections "Creating a database with locale-based collation",
+"Creating a case-insensitive database", and "Character-based collation in
+<ph conref="../conrefs.dita#prod/productshortname"></ph>" in the
+<ph conref="../conrefs.dita#pub/citdevelop"></ph>.</p>
+<p>If a qualified index
name is specified, the schema name cannot begin with <codeph>SYS</codeph>.</p> </refsyn>
<section id="sqlj27363"><title>Indexes and constraints</title><p>Unique, primary
key, and foreign key constraints generate indexes that enforce or "back" the
Modified: db/derby/docs/trunk/src/ref/rrefsqlj58560.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj58560.dita?rev=1517897&r1=1517896&r2=1517897&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj58560.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj58560.dita Tue Aug 27 17:49:58 2013
@@ -22,11 +22,23 @@ limitations under the License.
<title>Data type assignments and comparison, sorting, and ordering</title>
<shortdesc></shortdesc>
<prolog><metadata>
-<keywords><indexterm>data types<indexterm>assignments and comparisions</indexterm></indexterm>
+<keywords><indexterm>data types<indexterm>assignments and comparisons</indexterm></indexterm>
</keywords>
</metadata></prolog>
<refbody>
-<section><p>The following table displays valid assignments between data types in
+<section><p>The tables in this section show valid assignments and comparisons
+between <ph conref="../conrefs.dita#prod/productshortname"></ph> data types.</p>
+<p>Sorting and ordering of character data is controlled by the collation
+specified for a database when it is created, as well as the locale of the
+database. For details, see
+<xref href="rrefattribcollation.dita#rrefattribcollation"><i>collation=collation</i> attribute</xref>
+and
+<xref href="rrefattrib56769.dita#rrefattrib56769"><i>territory=ll_CC</i> attribute</xref>,
+as well as the sections "Creating a database with locale-based collation",
+"Creating a case-insensitive database", and "Character-based collation in
+<ph conref="../conrefs.dita#prod/productshortname"></ph>" in the
+<ph conref="../conrefs.dita#pub/citdevelop"></ph>.</p>
+<p>The following table displays valid assignments between data types in
<ph conref="../conrefs.dita#prod/productshortname"></ph>. A "Y" indicates that
the assignment is valid.</p>
<table>