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 jt...@apache.org on 2006/02/18 21:48:14 UTC

svn commit: r378773 - /db/derby/docs/trunk/src/ref/rrefsqlj1083019.dita

Author: jta
Date: Sat Feb 18 12:48:12 2006
New Revision: 378773

URL: http://svn.apache.org/viewcvs?rev=378773&view=rev
Log:
DERBY-608 Applied Eric Radzinski's patch that updates the Reference Guide to
reflect support for dynamic parameters for unary +/-.

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

Modified: db/derby/docs/trunk/src/ref/rrefsqlj1083019.dita
URL: http://svn.apache.org/viewcvs/db/derby/docs/trunk/src/ref/rrefsqlj1083019.dita?rev=378773&r1=378772&r2=378773&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj1083019.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj1083019.dita Sat Feb 18 12:48:12 2006
@@ -1,4 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "reference.dtd">
 <!-- 
 Copyright 1997, 2005 The Apache Software Foundation or its licensors, as applicable.  
 
@@ -14,9 +17,6 @@
 See the License for the specific language governing permissions and  
 limitations under the License.
 -->
-
-<!DOCTYPE reference PUBLIC "-//IBM//DTD DITA Reference//EN"
- "../dtd/reference.dtd">
 <reference id="rrefsqlj1083019" xml:lang="en-us">
 <title>Where dynamic parameters are allowed</title>
 <refbody>
@@ -79,8 +79,9 @@
 list of an INSERT statement. The type of the dynamic parameter is assumed
 to be the type of the target column. A ? parameter is not allowed by itself
 in any select list, including the select list of a subquery, unless there
-is a corresponding column in a UNION, INTERSECT, or EXCEPT (see no. <xref href="rrefsqlj1083019.dita#rrefsqlj1083019/sqlj20756">16</xref>,
-below) that is not dynamic.   <codeblock><b>INSERT INTO t VALUES (?)
+is a corresponding column in a UNION, INTERSECT, or EXCEPT (see no. <xref
+href="rrefsqlj1083019.dita#rrefsqlj1083019/sqlj20756">16</xref>, below) that
+is not dynamic.   <codeblock><b>INSERT INTO t VALUES (?)
 <ph>-- dynamic parameter assumed to be the type
 -- of the only column in table t</ph>
 INSERT INTO t SELECT ?
@@ -99,8 +100,13 @@
 <li>A dynamic parameter is allowed as the value in an UPDATE statement. The
 type of the dynamic parameter is assumed to be the type of the column in the
 target table.   <codeblock><b>UPDATE t2 SET c2 =? <ph>-- type is assumed to be type of c2</ph></b></codeblock></li>
-<li>A dynamic parameter is not allowed as the operand of the unary operators
-- or +. </li>
+<li>Dynamic parameters are allowed as the operand of the unary operators -
+or +. For example:<codeblock><b>CREATE TABLE t1 (c11 INT, c12 SMALLINT, c13 DOUBLE, c14 CHAR(3))
+SELECT * FROM t1 WHERE c11 BETWEEN -? AND +?
+<ph>-– The type of both of the unary operators is INT
+-- based on the context in which they are used (that is,
+-- because c11 is INT, the unary parameters also get the 
+-- type INT.</ph></b></codeblock></li>
 <li>LENGTH allow a dynamic parameter. The type is assumed to be a maximum
 length VARCHAR type.   <codeblock><b>SELECT LENGTH(?)</b></codeblock></li>
 <li>Qualified comparisons.   <codeblock><b>? = SOME (SELECT 1 FROM t)
@@ -121,13 +127,6 @@
 </ol></p></section>
 <section><p>Once the type of a dynamic parameter is determined based on the
 expression it is in, that expression is allowed anywhere it would normally
-be allowed if it did not include a dynamic parameter. For example, above we
-said that a dynamic parameter cannot be used as the operand of a unary -.
-It can, however, appear within an expression that is the operand of a unary
-minus, such as:   <codeblock><b>- (1+?)</b></codeblock></p></section>
-<section><p>The dynamic parameter is assumed to be an INTEGER (because the
-binary operator +'s other operand is of the type INT). Because we know its
-type, it is allowed as the operand of a unary -.</p></section>
+be allowed if it did not include a dynamic parameter.</p></section>
 </refbody>
 </reference>
-