db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chaa...@apache.org
Subject svn commit: r930287 - in /db/derby/docs/trunk/src/ref: refderby.ditamap rrefsistabssysperms.dita rrefsistabssyssequences.dita rrefsqljcreatesequence.dita rrefsqljdropsequence.dita rrefsqljgrant.dita rrefsqljnextvaluefor.dita rrefsqljrevoke.dita
Date Fri, 02 Apr 2010 14:53:05 GMT
Author: chaase3
Date: Fri Apr  2 14:53:04 2010
New Revision: 930287

URL: http://svn.apache.org/viewvc?rev=930287&view=rev
Log:
DERBY-4568: Documentation needed for sequence generators

Added 5 new topics, modified 2 others (and map file).

Patch: DERBY-4568-2.diff

Added:
    db/derby/docs/trunk/src/ref/rrefsistabssysperms.dita   (with props)
    db/derby/docs/trunk/src/ref/rrefsistabssyssequences.dita   (with props)
    db/derby/docs/trunk/src/ref/rrefsqljcreatesequence.dita   (with props)
    db/derby/docs/trunk/src/ref/rrefsqljdropsequence.dita   (with props)
    db/derby/docs/trunk/src/ref/rrefsqljnextvaluefor.dita   (with props)
Modified:
    db/derby/docs/trunk/src/ref/refderby.ditamap
    db/derby/docs/trunk/src/ref/rrefsqljgrant.dita
    db/derby/docs/trunk/src/ref/rrefsqljrevoke.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=930287&r1=930286&r2=930287&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/refderby.ditamap (original)
+++ db/derby/docs/trunk/src/ref/refderby.ditamap Fri Apr  2 14:53:04 2010
@@ -156,6 +156,8 @@ limitations under the License.
 </topicref>
 <topicref href="rrefcreaterole.dita" navtitle="CREATE ROLE statement"></topicref>
 <topicref href="rrefsqlj31580.dita" navtitle="CREATE SCHEMA statement"></topicref>
+<topicref href="rrefsqljcreatesequence.dita" navtitle="CREATE SEQUENCE statement">
+</topicref>
 <topicref href="rrefsqljcreatesynonym.dita" navtitle="CREATE SYNONYM statement">
 </topicref>
 <topicref collection-type="family" href="rrefsqlj24513.dita" navtitle="CREATE TABLE statement">
@@ -183,6 +185,8 @@ limitations under the License.
 </topicref>
 <topicref href="rrefdroprole.dita" navtitle="DROP ROLE statement"></topicref>
 <topicref href="rrefsqlj31648.dita" navtitle="DROP SCHEMA statement"></topicref>
+<topicref href="rrefsqljdropsequence.dita" navtitle="DROP SEQUENCE statement">
+</topicref>
 <topicref href="rrefsqljdropsynonym.dita" navtitle="DROP SYNONYM statement">
 </topicref>
 <topicref href="rrefsqlj34148.dita" navtitle="DROP TABLE statement"></topicref>
@@ -233,6 +237,7 @@ limitations under the License.
 </topicref>
 </topicref>
 </topicref>
+<topicref href="rrefsqljnextvaluefor.dita" navtitle="NEXT VALUE FOR expression"></topicref>
 <topicref href="rrefsqlj11277.dita" navtitle="VALUES expression"></topicref>
 <topicref href="rrefsqlj1080779.dita" navtitle="Expression precedence"></topicref>
 <topicref href="rrefsqlj23075.dita" navtitle="Boolean expression"></topicref>
@@ -479,11 +484,14 @@ data type"></topicref>
 <topicref href="rrefsistabs13420.dita" navtitle="SYSFOREIGNKEYS system table">
 </topicref>
 <topicref href="rrefsistabs33921.dita" navtitle="SYSKEYS system table"></topicref>
+<topicref href="rrefsistabssysperms.dita" navtitle="SYSPERMS system table"></topicref>
 <topicref href="rrefsistabssysroles.dita" navtitle="SYSROLES system table"></topicref>
 <topicref href="rrefsistabssysroutineperms.dita" navtitle="SYSROUTINEPERMS system table">
 </topicref>
 <topicref href="rrefsistabs12085.dita" navtitle="SYSSCHEMAS system table">
 </topicref>
+<topicref href="rrefsistabssyssequences.dita" navtitle="SYSSEQUENCES system table">
+</topicref>
 <topicref href="rrefsistabslilanguageitemsysstatistics.dita" navtitle="SYSSTATISTICS system
table">
 </topicref>
 <topicref href="rrefsistabs33768.dita" navtitle="SYSSTATEMENTS system table">

Added: db/derby/docs/trunk/src/ref/rrefsistabssysperms.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsistabssysperms.dita?rev=930287&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsistabssysperms.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsistabssysperms.dita Fri Apr  2 14:53:04 2010
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+ 
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "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="rrefsistabssysperms" xml:lang="en-us">
+<title>SYSPERMS system table</title>
+<shortdesc>The SYSPERMS system table describes the USAGE permissions for
+sequence generators.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>system tables<indexterm>SYSPERMS</indexterm></indexterm>
+<indexterm>sequence generators<indexterm>SYSPERMS system table</indexterm></indexterm>
+<indexterm>SYSPERMS system table</indexterm></keywords>
+</metadata></prolog>
+<refbody>
+<section>
+<table frame="all" pgwide="1">
+<tgroup cols="5" colsep="1" rowsep="1"><colspec colname="1" colnum="1" colwidth="27*"/>
+<colspec colname="2" colnum="2" colwidth="10*"/><colspec colname="3" colnum="3"
+colwidth="11*"/><colspec colname="4" colnum="4" colwidth="14*"/><colspec colname="5"
+colnum="5" colwidth="38*"/>
+<thead>
+<row>
+<entry align="left" colname="1" valign="bottom">Column Name</entry>
+<entry align="left" colname="2" valign="bottom">Type</entry>
+<entry align="left" colname="3" valign="bottom">Length</entry>
+<entry align="left" colname="4" valign="bottom">Nullability</entry>
+<entry align="left" colname="5" valign="bottom">Contents</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry colname="1">PERMISSIONID</entry>
+<entry colname="2">CHAR</entry>
+<entry colname="3">36</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The unique id of the permission. This is the primary key.</entry>
+</row>
+<row>
+<entry colname="1">OBJECTTYPE</entry>
+<entry colname="2">VARCHAR</entry>
+<entry colname="3">36</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The kind of object receiving the permission. The only valid
+value is 'SEQUENCE'.</entry>
+</row>
+<row>
+<entry colname="1">OBJECTID</entry>
+<entry colname="2">CHAR</entry>
+<entry colname="3">36</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The object receiving the permission. The only valid values
+are SEQUENCEIDs.</entry>
+</row>
+<row>
+<entry colname="1">PERMISSION</entry>
+<entry colname="2">CHAR</entry>
+<entry colname="3">36</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The type of the permission. The only valid value is 'USAGE'.</entry>
+</row>
+<row>
+<entry colname="1">GRANTOR</entry>
+<entry colname="2">VARCHAR</entry>
+<entry colname="3">128</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The authorization ID of the user who granted the privilege.
+Privileges can be granted only by the object owner.</entry>
+</row>
+<row>
+<entry colname="1">GRANTEE</entry>
+<entry colname="2">VARCHAR</entry>
+<entry colname="3">128</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The authorization ID of the user or role to which the
+privilege was granted.</entry>
+</row>
+<row>
+<entry colname="1">ISGRANTABLE</entry>
+<entry colname="2">CHAR</entry>
+<entry colname="3">1</entry>
+<entry colname="4">False</entry>
+<entry colname="5">If the GRANTEE is the owner of the sequence generator, this
+value is 'Y'. If the GRANTEE is not the owner of the sequence generator, this
+value is 'N'.</entry>
+</row>
+</tbody>
+</tgroup>
+</table>
+</section>
+</refbody>
+</reference>

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

Added: db/derby/docs/trunk/src/ref/rrefsistabssyssequences.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsistabssyssequences.dita?rev=930287&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsistabssyssequences.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsistabssyssequences.dita Fri Apr  2 14:53:04 2010
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+ 
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "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="rrefsistabssyssequences" xml:lang="en-us">
+<title>SYSSEQUENCES system table</title>
+<shortdesc>The SYSSEQUENCES system table describes the sequence generators in
+the database.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>system tables<indexterm>SYSSEQUENCES</indexterm></indexterm>
+<indexterm>sequence generators<indexterm>SYSSEQUENCES system table</indexterm></indexterm>
+<indexterm>SYSSEQUENCES system table</indexterm></keywords>
+</metadata></prolog>
+<refbody>
+<section>
+<table frame="all" pgwide="1">
+<tgroup cols="5" colsep="1" rowsep="1"><colspec colname="1" colnum="1" colwidth="27*"/>
+<colspec colname="2" colnum="2" colwidth="10*"/><colspec colname="3" colnum="3"
+colwidth="11*"/><colspec colname="4" colnum="4" colwidth="14*"/><colspec colname="5"
+colnum="5" colwidth="38*"/>
+<thead>
+<row>
+<entry align="left" colname="1" valign="bottom">Column Name</entry>
+<entry align="left" colname="2" valign="bottom">Type</entry>
+<entry align="left" colname="3" valign="bottom">Length</entry>
+<entry align="left" colname="4" valign="bottom">Nullability</entry>
+<entry align="left" colname="5" valign="bottom">Contents</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry colname="1">SEQUENCEID</entry>
+<entry colname="2">CHAR</entry>
+<entry colname="3">36</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The id of the sequence generator. This is the primary key.</entry>
+</row>
+<row>
+<entry colname="1">SCHEMAID</entry>
+<entry colname="2">CHAR</entry>
+<entry colname="3">36</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The id of the schema which holds the sequence generator.
+There is a foreign key linking this column to SYS.SYSSCHEMAS.SCHEMAID.</entry>
+</row>
+<row>
+<entry colname="1">SEQUENCENAME</entry>
+<entry colname="2">VARCHAR</entry>
+<entry colname="3">128</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The name of the sequence generator. There is a unique index
+on (SCHEMAID, SEQUENCENAME).</entry>
+</row>
+<row>
+<entry colname="1">SEQUENCEDATATYPE</entry>
+<entry colname="2"><i>org.apache.derby.catalog.TypeDescriptor</i>
+<p>This class is not part of the public API.</p></entry>
+<entry colname="3">&nbsp;</entry>
+<entry colname="4">False</entry>
+<entry colname="5">System type that describes the precision, length, scale,
+nullability, type name, and storage type of the data.</entry>
+</row>
+<row>
+<entry colname="1">CURRENTVALUE</entry>
+<entry colname="2">BIGINT</entry>
+<entry colname="3">&nbsp;</entry>
+<entry colname="4">True</entry>
+<entry colname="5">The current value of the sequence generator. The initial
+value of this column is STARTVALUE. This column is NULL only if the sequence
+generator is exhausted and cannot issue any more numbers.</entry>
+</row>
+<row>
+<entry colname="1">STARTVALUE</entry>
+<entry colname="2">BIGINT</entry>
+<entry colname="3">&nbsp;</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The initial value of the sequence generator.</entry>
+</row>
+<row>
+<entry colname="1">MINIMUMVALUE</entry>
+<entry colname="2">BIGINT</entry>
+<entry colname="3">&nbsp;</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The minimum value of the sequence generator.</entry>
+</row>
+<row>
+<entry colname="1">MAXIMUMVALUE</entry>
+<entry colname="2">BIGINT</entry>
+<entry colname="3">&nbsp;</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The maximum value of the sequence generator.</entry>
+</row>
+<row>
+<entry colname="1">INCREMENT</entry>
+<entry colname="2">BIGINT</entry>
+<entry colname="3">&nbsp;</entry>
+<entry colname="4">False</entry>
+<entry colname="5">The step size of the sequence generator.</entry>
+</row>
+<row>
+<entry colname="1">CYCLEOPTION</entry>
+<entry colname="2">CHAR</entry>
+<entry colname="3">1</entry>
+<entry colname="4">False</entry>
+<entry colname="5">If the sequence generator cycles, this value is 'Y'. If the
+sequence generator does not cycle, this value is 'N'.</entry>
+</row>
+</tbody>
+</tgroup>
+</table>
+</section>
+</refbody>
+</reference>

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

Added: db/derby/docs/trunk/src/ref/rrefsqljcreatesequence.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljcreatesequence.dita?rev=930287&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljcreatesequence.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljcreatesequence.dita Fri Apr  2 14:53:04 2010
@@ -0,0 +1,109 @@
+<?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="rrefsqljcreatesequence" xml:lang="en-us">
+<title>CREATE SEQUENCE statement</title>
+<prolog><metadata>
+<keywords><indexterm>CREATE SEQUENCE statement</indexterm>
+<indexterm>SQL statements<indexterm>CREATE SEQUENCE</indexterm></indexterm>
+<indexterm>sequence generators<indexterm>creating</indexterm></indexterm>
+</keywords>
+</metadata></prolog>
+<refbody>
+<section><p>The CREATE SEQUENCE statement creates a sequence generator, which
is
+a mechanism for generating exact numeric values, one at a time.</p>
+<p>The owner of the schema where the sequence generator lives automatically
+gains the USAGE privilege on the sequence generator, and can grant this
+privilege to other users and roles. Only the
+<xref href="rrefattrib26867.dita#rrefattrib26867">database owner</xref> and the
+owner of the sequence generator can grant these USAGE privileges. The USAGE
+privilege cannot be revoked from the schema owner. See 
+<xref href="rrefsqljgrant.dita#rrefsqljgrant"></xref> and
+<xref href="rrefsqljrevoke.dita#rrefsqljrevoke"></xref> for more information.
+</p></section>
+<refsyn><title>Syntax</title>
+<codeblock><b>CREATE SEQUENCE <i><xref href="rrefsqljcreatesequence.dita#rrefsqljcreatesequence/rrefsqljcrseqsequencename">sequenceName</xref></i>
[ <i><xref href="rrefsqljcreatesequence.dita#rrefsqljcreatesequence/rrefsqljcrseqsequenceelement">sequenceElement</xref></i>
]*</b></codeblock>
+</refsyn>
+<section id="rrefsqljcrseqsequencename"><title>sequenceName</title>
+<codeblock><b>[ <i><xref 
+href="rrefschemaname.dita#rrefschemaname">schemaName</xref>.</i> ] <i><xref
+href="crefsqlj34834.dita#crefsqlj34834">SQL92Identifier</xref></i></b></codeblock>
+<p>If <i>schemaName</i> is not provided, the current schema is the default
+schema. If a qualified sequence name is specified, the schema name cannot
+begin with SYS.</p></section>
+<section id="rrefsqljcrseqsequenceelement"><title>sequenceElement</title>
+<codeblock><b>{
+  AS <i>dataType</i> 
+  | START WITH <i>signedInteger</i> 
+  | INCREMENT BY <i>signedInteger</i> 
+  | MAXVALUE <i>signedInteger</i> | NO MAXVALUE 
+  | MINVALUE <i>signedInteger</i> | NO MINVALUE 
+  | CYCLE | NO CYCLE 
+}</b></codeblock>
+<p>If specified, the <i>dataType</i> must be an integer type (SMALLINT,
INT, or
+BIGINT). If not specified, the default data type is INT.</p>
+<p>If specified, the INCREMENT value is a non-zero number which fits in a
+<i>DataType</i> value. If not specified, the INCREMENT defaults to 1. INCREMENT
+is the step by which the sequence generator advances. If INCREMENT is positive,
+the sequence numbers get larger over time. If INCREMENT is negative, the
+sequence numbers get smaller.</p>
+<p>If specified, MINVALUE must be an integer which fits in a <i>DataType</i>
+value. If MINVALUE is not specified, or if NO MINVALUE is specified, MINVALUE
+defaults to the smallest negative number which fits in a <i>DataType</i> value.
+</p>
+<p>If specified, MAXVALUE may not be greater than the largest positive integer
+that fits in a <i>DataType</i> value. If MAXVALUE is not specified, or if
+NO MAXVALUE is specified, MAXVALUE defaults to the largest positive integer
+which fits in a <i>DataType</i> value. MAXVALUE must be greater than MINVALUE.
+</p>
+<p>The START WITH clause specifies the initial value of the sequence generator.
+This value must fall between MINVALUE and MAXVALUE. If the START WITH clause is
+not specified, the initial value defaults to be:</p>
+<ul><li>MINVALUE if INCREMENT is positive</li>
+<li>MAXVALUE if INCREMENT is negative</li></ul>
+<p>The CYCLE clause controls what happens when the sequence generator exhausts
+its range and wraps around. If CYCLE is specified, the wraparound behavior is to
+reinitialize the sequence generator to its START value. If NO CYCLE is
+specified, <ph conref="../conrefs.dita#prod/productshortname"></ph> throws an
+exception when the generator wraps around. The default behavior is NO CYCLE.</p>
+<p>To retrieve the next value from a sequence generator, use a
+<xref href="rrefsqljnextvaluefor.dita#rrefsqljnextvaluefor">NEXT VALUE FOR
+expression</xref>.
+</p></section>
+
+<example><title>Examples</title>
+<p>The following statement creates a sequence generator of type INT, with a
+start value of -2147483648 (the smallest INT value). The value increases by 1,
+and the last legal value is the largest possible INT. If NEXT VALUE FOR is
+invoked on the generator again,
+<ph conref="../conrefs.dita#prod/productshortname"></ph> throws an exception.
+</p>
+<codeblock><b>CREATE SEQUENCE order_id;</b></codeblock>
+<p>The following statement creates a sequence of type BIGINT with a start value
+of 3,000,000,000. The value increases by 1, and the last legal value is the
+largest possible BIGINT. If NEXT VALUE FOR is invoked on the generator again,
+<ph conref="../conrefs.dita#prod/productshortname"></ph> throws an exception.
+</p>
+<codeblock><b>CREATE SEQUENCE order_entry_id
+AS BIGINT
+START WITH 3000000000;</b></codeblock>
+</example>
+</refbody>
+</reference>

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

Added: db/derby/docs/trunk/src/ref/rrefsqljdropsequence.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljdropsequence.dita?rev=930287&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljdropsequence.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljdropsequence.dita Fri Apr  2 14:53:04 2010
@@ -0,0 +1,52 @@
+<?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="rrefsqljdropsequence" xml:lang="en-us">
+<title>DROP SEQUENCE statement</title>
+<prolog><metadata>
+<keywords><indexterm>DROP SEQUENCE statement</indexterm>
+<indexterm>SQL statements<indexterm>DROP SEQUENCE</indexterm></indexterm>
+<indexterm>sequence generators<indexterm>dropping</indexterm></indexterm>
+</keywords>
+</metadata></prolog>
+<refbody>
+<section><p>The DROP SEQUENCE statement removes a sequence generator that was
+created using a <xref href="rrefsqljcreatesequence.dita#rrefsqljcreatesequence"></xref>.</p></section>
+<refsyn><title>Syntax</title>
+<codeblock><b>DROP SEQUENCE <i><xref href="rrefsqljdropsequence.dita#rrefsqljdropsequence/rrefsqljdrseqsequencename">sequenceName</xref></i>
RESTRICT
+</b></codeblock>
+<p>The RESTRICT keyword is required. If a trigger or view references the
+sequence generator, <ph conref="../conrefs.dita#prod/productshortname"></ph>
+throws an exception.</p>
+<p>Dropping a sequence generator implicitly drops all USAGE privileges that
+reference it.</p>
+</refsyn>
+<section id="rrefsqljdrseqsequencename"><title>sequenceName</title>
+<codeblock><b>[ <i><xref 
+href="rrefschemaname.dita#rrefschemaname">schemaName</xref>.</i> ] <i><xref
+href="crefsqlj34834.dita#crefsqlj34834">SQL92Identifier</xref></i></b></codeblock>
+<p>If <i>schemaName</i> is not provided, the current schema is the default
+schema. If a qualified sequence name is specified, the schema name cannot
+begin with SYS.</p></section>
+<example><title>Example</title>
+<codeblock><b>DROP SEQUENCE order_id RESTRICT;</b></codeblock>
+</example>
+</refbody>
+</reference>

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

Modified: db/derby/docs/trunk/src/ref/rrefsqljgrant.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljgrant.dita?rev=930287&r1=930286&r2=930287&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljgrant.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqljgrant.dita Fri Apr  2 14:53:04 2010
@@ -40,6 +40,7 @@ from a table.</li>
 <li>Create a trigger on a table.</li>
 <li>Update data in a table or in a subset of columns in a table.</li>
 <li>Run a specified function or procedure.</li>
+<li>Use a sequence generator.</li>
 </ul></p><p>Before you issue a GRANT statement, check that the
 <codeph><xref href="rrefpropersqlauth.dita#rrefpropersqlauth">derby.database.sqlAuthorization</xref></codeph>
property
 is set to <codeph>true</codeph>. The <codeph>derby.database.sqlAuthorization</codeph>
property
@@ -49,7 +50,7 @@ object if you are the owner of the objec
 CREATE statement for the database object that you want to grant privileges on
 for more information.</p><p>The
 syntax that you use for the GRANT statement depends on whether you are granting
-privileges to a table or to a routine, or granting a role.</p>
+privileges to a table, a routine, or a sequence generator, or granting a role.</p>
 <p>For more information on using the GRANT statement, see "Using SQL standard
 authorization" in the <ph conref="../conrefs.dita#pub/citdevelop"></ph>.</p>
 </section>
@@ -60,6 +61,12 @@ href="rrefviewname.dita#rrefviewname"></
 <section><title>Syntax for routines</title><codeblock><b>GRANT
EXECUTE ON { FUNCTION | PROCEDURE } <i><xref
 href="rrefsqljgrant.dita#rrefsqljgrant/grantroutinename">routine-designator</xref></i>
TO <i><xref
 href="rrefsqljgrant.dita#rrefsqljgrant/grantgrantees">grantees</xref></i></b></codeblock></section>
+<section id="grantsequencesyn"><title>Syntax for sequence generators</title>
+<codeblock><b>GRANT USAGE ON SEQUENCE <i><xref href="rrefsqljgrant.dita#rrefsqljgrant/rrefsqljgrseqsequencename">sequenceName</xref></i>
TO <i><xref href="rrefsqljgrant.dita#rrefsqljgrant/grantgrantees">grantees</xref></i></b></codeblock>
+<p>In order to use a sequence generator, you must have the USAGE privilege on
+it. This privilege can be granted to users and to roles. See 
+<xref href="rrefsqljcreatesequence.dita#rrefsqljcreatesequence"></xref> for more
+information.</p></section>
 <section id="grantrolesyn"><title>Syntax for roles</title>
 <codeblock><b>GRANT <i><xref href="rrefrolename.dita#rrefrolename">roleName</xref></i>
[ {, <i><xref
 href="rrefrolename.dita#rrefrolename">roleName</xref></i> }* ] TO <i><xref

@@ -133,6 +140,13 @@ role.</p></section>
 <section id="grantroutinename"><title>routine-designator</title><codeblock><b>{
 	<i>function-name</i> | <i>procedure-name</i>
 }</b></codeblock></section>
+<section id="rrefsqljgrseqsequencename"><title>sequenceName</title>
+<codeblock><b>[ <i><xref 
+href="rrefschemaname.dita#rrefschemaname">schemaName</xref>.</i> ] <i><xref
+href="crefsqlj34834.dita#crefsqlj34834">SQL92Identifier</xref></i></b></codeblock>
+<p>If <i>schemaName</i> is not provided, the current schema is the default
+schema. If a qualified sequence name is specified, the schema name cannot
+begin with SYS.</p></section>
 <example id="grantexamples"><title>Examples</title><p>To grant the
SELECT
 privilege on table <codeph>t</codeph> to the authorization IDs <codeph>maria</codeph>
and <codeph>harry</codeph>,
 use the following syntax:<codeblock><b>GRANT SELECT ON TABLE t TO maria,harry</b>
</codeblock></p><p>To
@@ -148,6 +162,10 @@ syntax:</p>
 <p>To grant the SELECT privilege on table <codeph>t</codeph> to the role
 <codeph>purchases_reader_role</codeph>, use the following syntax:</p>
 <codeblock><b>GRANT SELECT ON TABLE t TO purchases_reader_role</b></codeblock>
+<p>To grant the USAGE privilege on the sequence generator
+<codeph>order_id</codeph> to the role <codeph>sales_role</codeph>,
use the
+following syntax:</p>
+<codeblock><b>GRANT USAGE ON SEQUENCE order_id TO sales_role;</b></codeblock>
 </example>
 
 </refbody>

Added: db/derby/docs/trunk/src/ref/rrefsqljnextvaluefor.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljnextvaluefor.dita?rev=930287&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljnextvaluefor.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljnextvaluefor.dita Fri Apr  2 14:53:04 2010
@@ -0,0 +1,93 @@
+<?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="rrefsqljnextvaluefor" xml:lang="en-us">
+<title>NEXT VALUE FOR expression</title>
+<prolog><metadata>
+<keywords><indexterm>NEXT VALUE FOR expression</indexterm>
+<indexterm>expressions<indexterm>NEXT VALUE FOR</indexterm></indexterm>
+<indexterm>sequence generators<indexterm>obtaining next value</indexterm></indexterm>
+</keywords>
+</metadata></prolog>
+<refbody>
+<section><p>The NEXT VALUE FOR expression retrieves the next value from a
+sequence generator that was created with a
+<xref href="rrefsqljcreatesequence.dita#rrefsqljcreatesequence"></xref>.</p></section>
+<refsyn><title>Syntax</title>
+<codeblock><b>NEXT VALUE FOR <i><xref href="rrefsqljnextvaluefor.dita#rrefsqljnextvaluefor/rrefsqljnvfsequencename">sequenceName</xref></i></b></codeblock>
+<p>If this is the first use of the sequence generator, the generator returns its
+START value. Otherwise, the INCREMENT value is added to the previous value
+returned by the sequence generator. The data type of the value is the
+<i>dataType</i> specified for the sequence generator.</p>
+<p>If the sequence generator wraps around, then one of the following happens:</p>
+<ul>
+<li>If the sequence generator was created using the CYCLE keyword, the sequence
+generator is reset to its START value.</li>
+<li>If the sequence generator was created with the default NO CYCLE behavior,
+<ph conref="../conrefs.dita#prod/productshortname"></ph> throws an exception.
+</li></ul>
+<p>In order to retrieve the next value of a sequence generator, you or your
+session's current role must have USAGE privilege on the generator.</p>
+<p>A NEXT VALUE FOR expression may occur in the following places:</p>
+<ul>
+<li><xref href="rrefsqlj41360.dita#rrefsqlj41360">SELECT statement</xref>:
+As part of the expression defining a returned column in a SELECT list</li>
+<li><xref href="rrefsqlj11277.dita#rrefsqlj11277">VALUES expression</xref>:
+As part of the expression defining a column in a row constructor (VALUES
+expression)</li>
+<li><xref href="rrefsqlj26498.dita#rrefsqlj26498">UPDATE statement</xref>;
+As part of the expression defining the new value to which a column is being
+set</li>
+</ul>
+<p>Only one NEXT VALUE FOR expression is allowed per sequence per statement.</p>
+<p>The NEXT VALUE FOR expression is not allowed in any statement which has a
+DISTINCT or ORDER BY expression.</p>
+<p>The next value of a sequence generator is not affected by whether the user
+commits or rolls back a transaction which invoked the sequence generator.</p>
+<p></p>
+<p>A NEXT VALUE expression may not appear in any of these situations:</p>
+<ul>
+<li>CASE expression</li>
+<li>WHERE clause</li>
+<li>ORDER BY clause</li>
+<li>Aggregate expression</li>
+<li>ROW_NUMBER function</li>
+<li>DISTINCT select list</li>
+</ul>
+</refsyn>
+<section id="rrefsqljnvfsequencename"><title>sequenceName</title>
+<codeblock><b>[ <i><xref 
+href="rrefschemaname.dita#rrefschemaname">schemaName</xref>.</i> ] <i><xref
+href="crefsqlj34834.dita#crefsqlj34834">SQL92Identifier</xref></i></b></codeblock>
+<p>If <i>schemaName</i> is not provided, the current schema is the default
+schema. If a qualified sequence name is specified, the schema name cannot
+begin with SYS.</p></section>
+<example><title>Examples</title>
+<codeblock><b>VALUES (NEXT VALUE FOR order_id);</b></codeblock>
+<codeblock><b>INSERT INTO re_order_table
+  SELECT NEXT VALUE FOR order_id, order_date, quantity
+  FROM orders
+  WHERE back_order = 1;</b></codeblock>
+<codeblock><b>UPDATE orders
+  SET oid = NEXT VALUE FOR order_id
+  WHERE expired = 1;</b></codeblock>
+</example>
+</refbody>
+</reference>

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

Modified: db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita?rev=930287&r1=930286&r2=930287&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita Fri Apr  2 14:53:04 2010
@@ -39,6 +39,7 @@ from a table.</li>
 <li>Create a trigger on a table.</li>
 <li>Update data in a table or in a subset of columns in a table.</li>
 <li>Run a specified routine (function or procedure).</li>
+<li>Use a sequence generator.</li>
 </ul></p><p>The
 <codeph><xref href="rrefpropersqlauth.dita#rrefpropersqlauth">derby.database.sqlAuthorization</xref></codeph>
 property must be set to <codeph>true</codeph> before you can use the GRANT
@@ -47,8 +48,8 @@ statement or the REVOKE statement. The
 enables SQL Authorization mode.</p><p>You can revoke privileges for an
 object if you are the owner of the object or the  <xref href="rrefattrib26867.dita#rrefattrib26867">database
 owner</xref>.</p><p>The syntax that you use for the REVOKE statement depends
-on whether you are revoking privileges to a table or to a routine, or whether
-you are revoking a role.</p>
+on whether you are revoking privileges to a table, a routine, or a sequence
+generator, or whether you are revoking a role.</p>
 <p>For more information on using the REVOKE statement, see "Using SQL standard
 authorization" in the <ph conref="../conrefs.dita#pub/citdevelop"></ph>.</p>
 </section>
@@ -64,6 +65,15 @@ must use the RESTRICT clause on REVOKE s
 clause specifies that the EXECUTE privilege cannot be revoked if the specified
 routine is used in a view, trigger, or constraint, and the privilege is being
 revoked from the owner of the view, trigger, or constraint.</p></section>
+<section id="revokesequencesyn"><title>Syntax for sequence generators</title>
+<codeblock><b>REVOKE USAGE ON SEQUENCE <i><xref href="rrefsqljrevoke.dita#rrefsqljrevoke/rrefsqljrevseqsequencename">sequenceName</xref></i>
FROM <i><xref href="rrefsqljrevoke.dita#rrefsqljrevoke/revokegrantees">grantees</xref></i>
RESTRICT</b></codeblock>
+<p>In order to use a sequence generator, you must have the USAGE privilege on
+it. This privilege can be revoked from users and roles. Only RESTRICTed revokes
+are allowed. This means that the REVOKE statement cannot make a view, trigger,
+or constraint unusable by its owner. The USAGE privilege cannot be revoked from
+the schema owner. See
+<xref href="rrefsqljcreatesequence.dita#rrefsqljcreatesequence"></xref> for more
+information.</p></section>
 <section><title>Syntax for roles</title>
 <codeblock><b>REVOKE <i><xref href="rrefrolename.dita#rrefrolename">roleName</xref></i>
[ {, <i><xref
 href="rrefrolename.dita#rrefrolename">roleName</xref></i> }* ] FROM <i><xref

@@ -115,7 +125,13 @@ of the owner of an object.</note></secti
 <section id="revokeroutinename"><title>routine-designator</title><codeblock><b>
 {
    <i>qualified-name</i> [ signature ]
   }</b></codeblock></section>
-
+<section id="rrefsqljrevseqsequencename"><title>sequenceName</title>
+<codeblock><b>[ <i><xref 
+href="rrefschemaname.dita#rrefschemaname">schemaName</xref>.</i> ] <i><xref
+href="crefsqlj34834.dita#crefsqlj34834">SQL92Identifier</xref></i></b></codeblock>
+<p>If <i>schemaName</i> is not provided, the current schema is the default
+schema. If a qualified sequence name is specified, the schema name cannot
+begin with SYS.</p></section>
 <section>
   <title>Prepared statements and open result sets/cursors</title>
   <p>
@@ -225,6 +241,10 @@ following syntax:</p>
 <p>To revoke the SELECT privilege on table <codeph>t</codeph> from the
role
 <codeph>purchases_reader_role</codeph>, use the following syntax:</p>
 <codeblock><b>REVOKE SELECT ON TABLE t FROM purchases_reader_role</b></codeblock>
+<p>To revoke the USAGE privilege on the sequence generator
+<codeph>order_id</codeph> from the role <codeph>sales_role</codeph>,
use the
+following syntax:</p>
+<codeblock><b>REVOKE USAGE ON SEQUENCE order_id FROM sales_role;</b></codeblock>
 </example>
 </refbody>
 </reference>



Mime
View raw message