db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r1798411 - in /db/derby/docs/trunk/src/ref: rrefsistabs22441.dita rrefsqlj37836.dita rrefsqlj81859.dita
Date Mon, 12 Jun 2017 01:44:09 GMT
Author: bpendleton
Date: Mon Jun 12 01:44:09 2017
New Revision: 1798411

URL: http://svn.apache.org/viewvc?rev=1798411&view=rev
Log:
DERBY-6936: Document new CYCLE option features.

This change updates the reference manual pages for ALTER TABLE, for
the SYSCOLUMNS system table, and for the identity column data type of
CREATE TABLE, to describe the new features added by DERBY-6904, DERBY-6905,
and DERBY-6906.


Modified:
    db/derby/docs/trunk/src/ref/rrefsistabs22441.dita
    db/derby/docs/trunk/src/ref/rrefsqlj37836.dita
    db/derby/docs/trunk/src/ref/rrefsqlj81859.dita

Modified: db/derby/docs/trunk/src/ref/rrefsistabs22441.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsistabs22441.dita?rev=1798411&r1=1798410&r2=1798411&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsistabs22441.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsistabs22441.dita Mon Jun 12 01:44:09 2017
@@ -124,6 +124,13 @@ column</entry>
 <entry colname="5">Amount column value is automatically incremented (if
 specified), if the column is an identity column</entry>
 </row>
+<row>
+<entry colname="1">AUTOINCREMENTCYCLE</entry>
+<entry colname="2">boolean</entry>
+<entry colname="3"></entry>
+<entry colname="4">true</entry>
+<entry colname="5">true if the column is an identity column which automatically cycles,
false otherwise (new with Release 10.14)</entry>
+</row>
 </tbody>
 </tgroup>
 </table>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj37836.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj37836.dita?rev=1798411&r1=1798410&r2=1798411&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj37836.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj37836.dita Mon Jun 12 01:44:09 2017
@@ -27,7 +27,7 @@ limitations under the License.
 <example> <codeblock><b>[ GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY

 [ ( START WITH <i>integerConstant</i> 
     | INCREMENT BY <i>integerConstant</i> 
-    | CYCLE )   ] ]
+    | [NO] CYCLE )   ] ]
 </b></codeblock></example>
 <section id="sqlj69411"><title>Identity column attributes</title>
 <p>A table can have at most one identity column.</p><p>For SMALLINT,
@@ -82,7 +82,35 @@ especially when loading or importing dat
 WITH value which corresponds to the first identity value that the system should
 assign. To check for this condition and disallow it, you can use a primary
 key or unique constraint on the GENERATED BY DEFAULT identity column.</p></dd>
-</dlentry></dl></p><p>By default, the initial value of an identity
column
+</dlentry>
+</dl></p>
+<p>
+The CYCLE clause controls what happens when the identity column exhausts
+its range and wraps around.
+<dl>
+<dlentry>
+<dt>CYCLE</dt>
+<dd>
+<p>
+If CYCLE is specified, the wraparound behavior is to
+reinitialize the the value of identity column to its minimum or maximum value.
+</p>
+</dd>
+</dlentry><dlentry>
+<dt>NO CYCLE</dt>
+<dd>
+<p>
+If NO CYCLE is specified, or if no CYCLE option is specified at all,
+ <ph conref="../conrefs.dita#prod/productshortname"></ph> throws an
+exception when the generator wraps around. The default is NO CYCLE: 
+an identity column does not cycle.
+Note that cycling restarts from the minimum or maximum value, 
+not from the start value.</p>
+</dd>
+</dlentry>
+</dl>
+</p>
+<p>By default, the initial value of an identity column
 is 1, the amount of the increment is 1, and does not cycle. You can specify non-default values
 for the initial value, the interval amount and the cycle option when you define the column
 with the key words START WITH, INCREMENT BY and CYCLE. And if you specify a negative
@@ -143,14 +171,8 @@ table</xref>. Rolling back a transaction
 transactions can leave "gaps" in the values automatically inserted into an
 identity column. <ph conref="../conrefs.dita#prod/productshortname"></ph> behaves
 this way to avoid locking a row in SYS.SYSCOLUMNS for the duration
-of a transaction and keeping concurrency high.</p><p>
-The CYCLE clause controls what happens when the identity column exhausts
-its range and wraps around. If CYCLE is specified, the wraparound behavior is to
-reinitialize the the value of identity column to its minimum or maximum value. If CYCLE is
not
-specified <ph conref="../conrefs.dita#prod/productshortname"></ph> throws an
-exception when the generator wraps around. In default behavior identity column
-does not cycle. Note that cycling restarts from the minimum or maximum value, 
-not from the start value.</p><p><indexterm>Identity
+of a transaction and keeping concurrency high.</p>
+<p><indexterm>Identity
 columns <indexterm>and triggers</indexterm></indexterm>When an insert happens
 within a <i>triggeredSQLStatement</i>, the value inserted by the
 <i>triggeredSQLStatement</i>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj81859.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj81859.dita?rev=1798411&r1=1798410&r2=1798411&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj81859.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj81859.dita Mon Jun 12 01:44:09 2017
@@ -40,8 +40,12 @@ tables</indexterm><indexterm>Tables<inde
 <li>Increase the width of a BLOB, CLOB, VARCHAR, or VARCHAR FOR BIT DATA
 column</li>
 <li>Override row-level locking for the table (or drop the override)</li>
+<li>Change an identity column in any of the following ways:
+<ul>
 <li>Change the increment value and start value of the identity column</li>
-<li>Change an identity column from ALWAYS to DEFAULT BY behavior or vice-versa</li>
+<li>Change the generation condition from ALWAYS to DEFAULT BY behavior or vice-versa</li>
+<li>Change the overflow handling from CYCLE to NO CYCLE behavior or vice-versa</li>
+</ul></li>
 <li>Change the nullability constraint for a column</li>
 <li>Change the default value for a column</li>
 </ul></p></section>
@@ -74,6 +78,7 @@ href="rrefconstraintname.dita#rrefconstr
 <i>columnName</i> { SET | DROP } NOT NULL |
 <i>columnName</i> [ NOT ] NULL |
 <i>columnName</i> [ WITH | SET ] DEFAULT <i>defaultValue</i> |
+<i>columnName</i> [ NO ] CYCLE |
 <i>columnName</i> DROP DEFAULT</b> </codeblock></example>
 <section><p>In the <i>columnAlteration</i>, SET INCREMENT BY <i>integerConstant</i>
specifies
 the interval between consecutive values of the identity column. The next value
@@ -106,6 +111,10 @@ SET GENERATED ALWAYS causes Derby to not
 SET GENERATED BY DEFAULT causes Derby to permit these overrides.
 </p>
 
+<p>
+The CYCLE clause controls what happens when the identity column exhausts its range and wraps
around (CYCLE) or throws an exception (NO CYCLE).
+</p>
+
 <p>ALTER
 TABLE does not affect any view that references the table being altered. This
 includes views that have an "*" in their SELECT list. You must drop and re-create
@@ -218,6 +227,12 @@ in the column for which the SET INCREMEN
 </p>
 </li>
 
+<li>Changing an identity column from CYCLE to NO CYCLE behavior or vice-versa.
+<p>
+The CYCLE clause controls what happens when the identity column exhausts its range and wraps
around (CYCLE) or throws an exception (NO CYCLE).
+</p>
+</li>
+
 <li>Changing the default value for a column.
 <p>You can use DEFAULT <i>default-value</i> to change a column default.
To disable a
 previously set default, use DROP DEFAULT (alternatively, you can specify NULL as
@@ -297,6 +312,9 @@ ALTER TABLE Employees ALTER COLUMN ssn N
 ALTER TABLE Employees ALTER COLUMN Salary DEFAULT 1000.0
 ALTER TABLE Employees ALTER COLUMN Salary DROP DEFAULT
 
+<ph>-- Enable CYCLE behavior for the message_id column</ph>
+ALTER TABLE messages ALTER COLUMN message_id CYCLE
+
 <ph>-- Bulk load a table by temporarily changing a GENERATED ALWAYS identity column
 -- into a GENERATED BY default column.
 -- After loading the table, reset the identity column to be GENERATED ALWAYS



Mime
View raw message