db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r754559 - in /db/derby/docs/trunk/src/ref: refderby.ditamap rrefsqlj41360.dita rrefsqljoffsetfetch.dita
Date Sat, 14 Mar 2009 23:53:39 GMT
Author: dag
Date: Sat Mar 14 23:53:38 2009
New Revision: 754559

URL: http://svn.apache.org/viewvc?rev=754559&view=rev
Log:
DERBY-4079 Add support for SQL:2008 <result offset clause> and <fetch first clause>
to limit result set cardinality

Add documentation for this feature, corresponding to patch derby-4079-docs-2.

Added:
    db/derby/docs/trunk/src/ref/rrefsqljoffsetfetch.dita   (with props)
Modified:
    db/derby/docs/trunk/src/ref/refderby.ditamap
    db/derby/docs/trunk/src/ref/rrefsqlj41360.dita

Modified: db/derby/docs/trunk/src/ref/refderby.ditamap
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/refderby.ditamap?rev=754559&r1=754558&r2=754559&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/refderby.ditamap (original)
+++ db/derby/docs/trunk/src/ref/refderby.ditamap Sat Mar 14 23:53:38 2009
@@ -221,6 +221,7 @@
 <topicref href="rrefsqlj32654.dita" navtitle="GROUP BY clause"></topicref>
 <topicref href="rrefsqlj14854.dita" navtitle="HAVING clause"></topicref>
 <topicref href="rrefsqlj13658.dita" navtitle="ORDER BY clause"></topicref>
+<topicref href="rrefsqljoffsetfetch.dita" navtitle="The result offset and fetch first
clauses"></topicref>
 <topicref href="rrefsqlj33602.dita" navtitle="WHERE clause"></topicref>
 <topicref href="rrefsqlj15309.dita" navtitle="WHERE CURRENT OF clause"></topicref>
 </topicref>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj41360.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj41360.dita?rev=754559&r1=754558&r2=754559&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj41360.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj41360.dita Sat Mar 14 23:53:38 2009
@@ -27,14 +27,21 @@
 <refbody>
 <refsyn><title>Syntax</title> <codeblock><b><i><xref
href="rrefsqlj21571.dita#rrefsqlj21571">Query</xref></i>
 [<i><xref href="rrefsqlj13658.dita#rrefsqlj13658">ORDER BY clause</xref></i>]
+[<i><xref href="rrefsqljoffsetfetch.dita#rrefsqljoffsetfetch">result offset clause</xref></i>]
+[<i><xref href="rrefsqljoffsetfetch.dita#rrefsqljoffsetfetch">fetch first clause</xref></i>]
 [<i><xref href="rrefsqlj31783.dita#rrefsqlj31783">FOR UPDATE clause</xref></i>]
-WITH {RR|RS|CS|UR}</b></codeblock></refsyn>
+[WITH {RR|RS|CS|UR}]</b></codeblock></refsyn>
 <section> <p>A SELECT statement consists of a query with an optional <xref
-href="rrefsqlj13658.dita#rrefsqlj13658">ORDER BY clause</xref> and an optional <xref
href="rrefsqlj31783.dita#rrefsqlj31783">FOR UPDATE clause</xref>.
+href="rrefsqlj13658.dita#rrefsqlj13658">ORDER BY clause</xref>, an optional <xref
href="rrefsqljoffsetfetch.dita#rrefsqljoffsetfetch">result offset clause</xref>,
an optional <xref href="rrefsqljoffsetfetch.dita#rrefsqljoffsetfetch">fetch first clause</xref>,
an optional <xref href="rrefsqlj31783.dita#rrefsqlj31783">FOR UPDATE clause</xref>
and optionally isolation level.
 The SELECT statement is so named because the typical first word of the query
 construct is SELECT. (<i>Query</i> includes the VALUES expression and UNION,
INTERSECT, and EXCEPT
 expressions as well as SELECT expressions).</p> <p>The <xref href="rrefsqlj13658.dita#rrefsqlj13658">ORDER
BY clause</xref> guarantees
-the ordering of the <i>ResultSet</i>. The <xref href="rrefsqlj31783.dita#rrefsqlj31783">FOR
UPDATE clause</xref> makes
+the ordering of the <i>ResultSet</i>. 
+The <xref href="rrefsqljoffsetfetch.dita#rrefsqljoffsetfetch">result offset clause</xref>
and the
+<xref href="rrefsqljoffsetfetch.dita#rrefsqljoffsetfetch">fetch first clause</xref>
can be used to fetch only a subset of the
+otherwise selected rows, possibly with an offset into the result set. 
+
+The <xref href="rrefsqlj31783.dita#rrefsqlj31783">FOR UPDATE clause</xref> makes
 the result set's cursor updatable. The SELECT statement supports the FOR FETCH
 ONLY clause. The FOR FETCH ONLY clause is synonymous with the FOR READ ONLY
 clause.</p> <p>You can set the isolation level in a

Added: db/derby/docs/trunk/src/ref/rrefsqljoffsetfetch.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljoffsetfetch.dita?rev=754559&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljoffsetfetch.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljoffsetfetch.dita Sat Mar 14 23:53:38 2009
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+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.
+-->
+
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.dtd">
+<reference id="rrefsqljoffsetfetch" xml:lang="en-us">
+
+<title>The result offset and fetch first clauses</title>
+
+<prolog>
+  <metadata>
+    <keywords>
+      <indexterm>result offset clause</indexterm>
+      <indexterm>fetch first clause</indexterm>
+    </keywords>
+  </metadata>
+</prolog>
+
+<refbody>
+<section> 
+  <p> The <i>result offset clause</i> provides a way to skip the N
+    first rows in a result set before starting to return any
+    rows. The <i>fetch first clause</i>, which can be combined with
+    the <i>result offset clause</i> if desired, limits the number of rows
+    returned in the result set. The <i>fetch first clause</i> can
+    sometimes be useful for retrieving only a few rows from an
+    otherwise large result set, usually in combination with an ORDER BY
+    clause. The use of this clause can give efficiency benefits. In
+    addition, it can make programming the application simpler.
+  </p> 
+</section>
+
+<refsyn>
+  <title>Syntax</title> 
+  <codeblock><b>OFFSET <i>integer-literal</i> {ROW | ROWS}
+    </b></codeblock> 
+
+  <codeblock><b>FETCH { FIRST | NEXT } [<i>integer-literal</i>] {ROW
| ROWS} ONLY
+    </b></codeblock> 
+<p>
+ROW is synonymous with ROWS and FIRST is synonymous with NEXT.
+</p>
+
+<p>
+For the <i>result offset clause</i> the integer literal must be equal to
+0 (default if the clause is not given), or positive. If it is larger
+than the number of rows in the underlying result set, no rows are
+returned.
+</p>
+
+<p>
+For the <i>fetch first clause</i>, the literal must be 1 or
+higher. The literal can be omitted, in which case it defaults to 1. If
+the clause is omitted entirely, all rows (or those rows remaining if
+a <i>result offset clause</i> is also given) will be returned.
+</p>
+
+<example>
+  <title>Examples</title>
+  <codeblock><b>
+SELECT * FROM T FETCH FIRST ROW ONLY
+SELECT * FROM T ORDER BY I OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY
+SELECT * FROM T OFFSET 100 ROWS
+</b></codeblock> </example>
+
+</refsyn>
+
+
+</refbody>
+</reference>
+

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



Mime
View raw message