db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r438290 - /db/derby/docs/trunk/src/ref/rrefcasenullif.dita
Date Tue, 29 Aug 2006 23:29:27 GMT
Author: jta
Date: Tue Aug 29 16:29:27 2006
New Revision: 438290

URL: http://svn.apache.org/viewvc?rev=438290&view=rev
Log:
DERBY-1575 Update Reference Guide to document full syntax of CASE expression.

Committed patch DERBY-1575_fix.diff by Kim Haase <camilla.haase@sun.com>.

Modified:
    db/derby/docs/trunk/src/ref/rrefcasenullif.dita

Modified: db/derby/docs/trunk/src/ref/rrefcasenullif.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefcasenullif.dita?rev=438290&r1=438289&r2=438290&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefcasenullif.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefcasenullif.dita Tue Aug 29 16:29:27 2006
@@ -26,15 +26,30 @@
 </keywords>
 </metadata></prolog>
 <refbody>
-<example><title>NULLIF expression syntax</title><codeblock>NULLIF(L,
R)</codeblock>The
-NULLIF expression is very similar to the CASE expression. For example: <codeblock>NULLIF(V1,V2)</codeblock>
is
-equivalent to the following CASE expression:<codeblock>CASE WHEN V1=V2 THEN NULL ELSE
V1 END</codeblock></example>
+<example><title>NULLIF expression syntax</title><codeblock><b>NULLIF
( L, R )</b></codeblock>The
+NULLIF expression is very similar to the CASE expression. For example: <codeblock><b>NULLIF(V1,V2)</b></codeblock>
is
+equivalent to the following CASE expression:<codeblock><b>CASE WHEN V1=V2 THEN
NULL ELSE V1 END</b></codeblock></example>
 <example><title>CASE expression syntax</title><p>You can place a
CASE expression
 anywhere an expression is allowed. It chooses an expression to evaluate based
-on a boolean test.</p><codeblock>CASE WHEN BooleanExpression THEN thenExpression
ELSE elseExpression END</codeblock><p><i>ThenExpression</i> and <i
->ElseExpression</i> are both expressions that must be type-compatible. For
+on a boolean test.</p>
+<codeblock><b>CASE 
+  WHEN <i>booleanExpression</i> THEN <i>thenExpression</i> 
+  [ WHEN <i>booleanExpression</i> THEN <i>thenExpression</i> ]...
+  ELSE <i>elseExpression</i> 
+END</b></codeblock>
+<p><i>ThenExpression</i> and <i>elseExpression</i> are both
expressions that must be type-compatible. For
 built-in types, this means that the types must be the same or a built-in broadening
-conversion must exist between the types.</p><codeblock><b>-- returns 3</b>
-VALUES CASE WHEN 1=1 THEN 3 ELSE 4 END;</codeblock></example>
+conversion must exist between the types.</p><codeblock><b>-- returns 3
+VALUES CASE WHEN 1=1 THEN 3 ELSE 4 END</b></codeblock>
+<codeblock><b>
+-- returns 7
+VALUES
+   CASE
+      WHEN 1 = 2 THEN 3
+      WHEN 4 = 5 THEN 6
+      ELSE 7
+   END
+</b></codeblock>
+</example>
 </refbody>
 </reference>



Mime
View raw message