db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrn...@apache.org
Subject svn commit: r547716 - in /db/derby/docs/trunk/src/ref: refderby.ditamap rrefkeywords29722.dita rrefsqlj19433.dita rrefsqlj55788.dita rreftrimfunc.dita
Date Fri, 15 Jun 2007 15:42:55 GMT
Author: myrnavl
Date: Fri Jun 15 08:42:54 2007
New Revision: 547716

URL: http://svn.apache.org/viewvc?view=rev&rev=547716
Log:
DERBY-2794: document (ansi) TRIM function.

Added:
    db/derby/docs/trunk/src/ref/rreftrimfunc.dita   (with props)
Modified:
    db/derby/docs/trunk/src/ref/refderby.ditamap
    db/derby/docs/trunk/src/ref/rrefkeywords29722.dita
    db/derby/docs/trunk/src/ref/rrefsqlj19433.dita
    db/derby/docs/trunk/src/ref/rrefsqlj55788.dita

Modified: db/derby/docs/trunk/src/ref/refderby.ditamap
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/refderby.ditamap?view=diff&rev=547716&r1=547715&r2=547716
==============================================================================
--- db/derby/docs/trunk/src/ref/refderby.ditamap (original)
+++ db/derby/docs/trunk/src/ref/refderby.ditamap Fri Jun 15 08:42:54 2007
@@ -275,6 +275,7 @@
 <topicref href="rreffunctan.dita" navtitle="TAN function"></topicref>
 <topicref href="rreftimefunc.dita" navtitle="TIME function"></topicref>
 <topicref href="rreftimestampfunc.dita" navtitle="TIMESTAMP function"></topicref>
+<topicref href="rreftrimfunc.dita" navtitle="TRIM function"></topicref>
 <topicref href="rrefsqlj29930.dita" navtitle="UCASE or UPPER function"></topicref>
 <topicref href="rrefsqlj42476.dita" navtitle="USER function"></topicref>
 <topicref href="rrefbuiltvarchar.dita" navtitle="VARCHAR function"></topicref>

Modified: db/derby/docs/trunk/src/ref/rrefkeywords29722.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefkeywords29722.dita?view=diff&rev=547716&r1=547715&r2=547716
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefkeywords29722.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefkeywords29722.dita Fri Jun 15 08:42:54 2007
@@ -214,6 +214,7 @@
 <sli>TRANSACTION</sli>
 <sli>TRANSLATE</sli>
 <sli>TRANSLATION</sli>
+<sli>TRIM</sli>
 <sli>TRUE</sli>
 <sli>UNION</sli>
 <sli>UNIQUE</sli>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj19433.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj19433.dita?view=diff&rev=547716&r1=547715&r2=547716
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj19433.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj19433.dita Fri Jun 15 08:42:54 2007
@@ -227,7 +227,7 @@
 <entry colname="2"> Built-in string functions</entry>
 <entry colname="3">The built-in string functions act on a String and return
 a string. See <xref href="rrefsqlj97870.dita#rrefsqlj97870"></xref>, <xref
-href="rrefsqlj42049.dita#rrefsqlj42049"></xref>, <xref href="rrefsqlj32613.dita#rrefsqlj32613"></xref>,
<xref
+href="rrefsqlj42049.dita#rrefsqlj42049"></xref>, <xref href="rrefsqlj32613.dita#rrefsqlj32613"></xref>,
<xref href="rreftrimfunc.dita#rreftrimfunc"></xref>, <xref
 href="rrefsqlj93082.dita#rrefsqlj93082"></xref>, and <xref href="rrefsqlj29930.dita#rrefsqlj29930"></xref>.</entry>
 </row>
 <row>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj55788.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj55788.dita?view=diff&rev=547716&r1=547715&r2=547716
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj55788.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj55788.dita Fri Jun 15 08:42:54 2007
@@ -72,6 +72,7 @@
 <li><xref href="rreffunctan.dita#rreffunctan"></xref></li>
 <li><xref href="rreftimefunc.dita#rreftimefunc"></xref></li>
 <li><xref href="rreftimestampfunc.dita#rreftimestampfunc"></xref></li>
+<li><xref href="rreftrimfunc.dita#rreftrimfunc"></xref></li>
 <li><xref href="rrefsqlj29930.dita#rrefsqlj29930"></xref></li>
 <li><xref href="rrefsqlj42476.dita#rrefsqlj42476"></xref></li>
 <li><xref href="rrefbuiltvarchar.dita#rrefbuiltvarchar"></xref></li>

Added: db/derby/docs/trunk/src/ref/rreftrimfunc.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rreftrimfunc.dita?view=auto&rev=547716
==============================================================================
--- db/derby/docs/trunk/src/ref/rreftrimfunc.dita (added)
+++ db/derby/docs/trunk/src/ref/rreftrimfunc.dita Fri Jun 15 08:42:54 2007
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+ 
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.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.
+-->
+<reference id="rreftrimfunc" xml:lang="en-us">
+<title>TRIM function</title>
+<prolog><metadata>
+<keywords><indexterm>functions<indexterm>TRIM</indexterm></indexterm>
+<indexterm>TRIM function</indexterm></keywords>
+</metadata></prolog>
+<refbody>
+<section>TRIM is a function that returns its first string argument with leading and/or
trailing pad characters removed. The second argument indicates whether leading, or trailing,
or both leading and trailing pad characters should be removed. The third argument specifies
the pad character that is to be removed.</section>
+<refsyn><title>Syntax</title> <codeblock>TRIM( [ <i>trimOperands</i>
] <i>trimSource</i>)</codeblock> 
+<p>
+<codeblock>
+<i>trimOperands</i>  ::= { <i>trimType</i> [ <i>trimCharacter
] </i> FROM | <i>trimCharacter</i> FROM }
+<i>trimType</i>      ::= { LEADING | TRAILING | BOTH }
+<i>trimCharacter</i> ::= <i>CharacterExpression</i>
+<i>trimSource</i>    ::= <i>CharacterExpression</i>
+</codeblock>
+</p><p>
+If <i>trimType</i> is not specified, it will default to BOTH. If <i>trimCharacter</i>
is not specified, it will default to the space character (' ').  Otherwise the <i>trimCharacter</i>
expression must evaulate to one of the following:
+	<ul>
+	    <li>a character string whose length is exactly one, or.</li>
+	    <li>NULL</li>
+	</ul>
+</p><p>
+If either <i>trimCharacter</i> or <i>trimSource</i> evaluates to
NULL, the result of the TRIM function is NULL.  Otherwise, the result of the TRIM function
is defined as follows:
+	<ul>
+	<li>If trimType is LEADING, the result will be the trimSource value with all leading
occurrences of trimChar removed.</li>
+	<li>If trimType is TRAILING, the result will be the trimSource value with all trailing
occurrences of trimChar removed.</li>
+	<li>If trimType is BOTH, the result will be the trimSource value with all leading
*and* trailing occurrences of trimChar removed.</li>
+	</ul>
+</p><p>
+If <i>trimSource</i>'s data type is CHAR or VARCHAR, the return type of the TRIM
function will be VARCHAR. Otherwise the return type of the TRIM function will be CLOB.
+</p>
+</refsyn>
+<example><title>Examples</title>
+<p>
+<codeblock><b><ph>-- returns 'derby' (no spaces)</ph>
+VALUES TRIM('  derby ')</b></codeblock> 
+</p><p>
+<codeblock><b><ph>-- returns 'derby' (no spaces)</ph>
+VALUES TRIM(BOTH ' ' FROM '  derby ')</b></codeblock> 
+</p><p>
+<codeblock><b><ph>-- returns 'derby ' (with a space at the end)</ph>
+VALUES TRIM(LEADING ' ' FROM '  derby ')</b></codeblock> 
+</p><p>
+<codeblock><b><ph>-- returns '  derby' (with two spaces at the beginning)</ph>
+VALUES TRIM(TRAILING ' ' FROM '  derby ')</b></codeblock> 
+</p><p>
+<codeblock><b><ph>-- returns NULL</ph>
+VALUES TRIM(cast (null as char(1)) FROM '  derby ')</b></codeblock> 
+</p><p>
+<codeblock><b><ph>-- returns NULL</ph>
+VALUES TRIM(' ' FROM cast(null as varchar(30)))</b></codeblock> 
+</p><p>
+<codeblock><b><ph>-- returns ' derb' (with a space at the beginning)</ph>
+VALUES TRIM('y' FROM ' derby')</b></codeblock> 
+</p><p>
+<codeblock><b><ph>-- results in an error because <i>trimCharacter</i>
can only be 1 character</ph>
+VALUES TRIM('by' FROM ' derby')</b></codeblock> 
+</p>
+</example>
+</refbody>
+</reference>

Propchange: db/derby/docs/trunk/src/ref/rreftrimfunc.dita
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message