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/09/22 18:46:59 UTC

svn commit: r448987 - /db/derby/docs/trunk/src/ref/

Author: jta
Date: Fri Sep 22 09:46:58 2006
New Revision: 448987

URL: http://svn.apache.org/viewvc?view=rev&rev=448987
Log:
DERBY-1839 Updates to the Reference Guide based on the 10.2 doc review.

Patch derby1839_SQLstatement_4.diff contributed by Laura Stewart <sc...@gmail.com>.

Modified:
    db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita
    db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita
    db/derby/docs/trunk/src/ref/rrefdeclaretemptable.dita
    db/derby/docs/trunk/src/ref/rrefsqlj15446.dita
    db/derby/docs/trunk/src/ref/rrefsqlj24513.dita
    db/derby/docs/trunk/src/ref/rrefsqlj31580.dita
    db/derby/docs/trunk/src/ref/rrefsqlj40506.dita
    db/derby/docs/trunk/src/ref/rrefsqlj43125.dita
    db/derby/docs/trunk/src/ref/rrefsqljgrant.dita
    db/derby/docs/trunk/src/ref/rrefsqljrenametablestatement.dita
    db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita

Modified: db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita Fri Sep 22 09:46:58 2006
@@ -23,14 +23,20 @@
 <shortdesc>The CREATE FUNCTION statement allows you to create Java functions,
 which you can then use in an expression.</shortdesc>
 <prolog><metadata>
-<keywords><indexterm>CREATE FUNCTION statement</indexterm></keywords>
+<keywords><indexterm>CREATE FUNCTION statement</indexterm><indexterm><indexterm>SQL
+statements</indexterm>CREATE FUNCTION</indexterm><indexterm>functions<indexterm>creating</indexterm></indexterm>
+</keywords>
 </metadata></prolog>
 <refbody>
-<section><title>Syntax</title> <codeblock><b>CREATE FUNCTION <i><xref href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement/rrefcrprofunctionname"
+<section><p>The function owner and the database owner automatically gain the
+EXECUTE privilege on the function, and are able to grant this privilege to
+other users. The EXECUTE privileges cannot be revoked from the function and
+database owners.</p></section>
+<refsyn><title>Syntax</title> <codeblock><b>CREATE FUNCTION <i><xref href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement/rrefcrprofunctionname"
 >function-name</xref></i> ( [ <xref href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement/rrefcrprofunctionparameter">FunctionParameter</xref
 > 
    [, <xref href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement/rrefcrprofunctionparameter">FunctionParameter</xref>] ] * ) RETURNS DataType [ <xref
-href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement/rrefcrprofunctionelement">FunctionElement</xref> ] *</b></codeblock></section>
+href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement/rrefcrprofunctionelement">FunctionElement</xref> ] *</b></codeblock></refsyn>
 <example id="rrefcrprofunctionname"><title>function-Name</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

Modified: db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita Fri Sep 22 09:46:58 2006
@@ -20,15 +20,23 @@
 -->
 <reference id="rrefcreateprocedurestatement" xml:lang="en-us">
 <title>CREATE PROCEDURE statement</title>
+<prolog><metadata>
+<keywords><indexterm>CREATE PROCEDURE statement</indexterm><indexterm><indexterm>SQL
+statements</indexterm>CREATE PROCEDURE</indexterm><indexterm>procedures<indexterm>creating</indexterm></indexterm>
+</keywords>
+</metadata></prolog>
 <refbody>
 <section><p>The CREATE PROCEDURE statement allows you to create Java stored
-procedures, which you can then call using the CALL PROCEDURE statement.</p></section>
-<section><title>Syntax</title><codeblock><b>CREATE PROCEDURE <i><xref href="rrefcreateprocedurestatement.dita#rrefcreateprocedurestatement/rrefcrproprocedurename"
+procedures, which you can then call using the CALL PROCEDURE statement.</p><p>The
+procedure owner and the database owner automatically gain the EXECUTE privilege
+on the procedure, and are able to grant this privilege to other users. The
+EXECUTE privileges cannot be revoked from the procedure and database owners.</p></section>
+<refsyn><title>Syntax</title><codeblock><b>CREATE PROCEDURE <i><xref href="rrefcreateprocedurestatement.dita#rrefcreateprocedurestatement/rrefcrproprocedurename"
 >procedure-Name</xref></i> ( [ <xref href="rrefcreateprocedurestatement.dita#rrefcreateprocedurestatement/rrefcrproprocedureparameter">ProcedureParameter</xref
 >
    [, <xref href="rrefcreateprocedurestatement.dita#rrefcreateprocedurestatement/rrefcrproprocedureparameter">ProcedureParameter</xref>] ] * )
 [ <xref href="rrefcreateprocedurestatement.dita#rrefcreateprocedurestatement/rrefcrproprocedureelement">ProcedureElement</xref> ] *</b></codeblock
-></section>
+></refsyn>
 <example id="rrefcrproprocedurename"><title>procedure-Name</title><codeblock><b>[ <i><xref
 href="rrefschemaname.dita#rrefschemaname">schemaName</xref>.</i> ] <i><xref
 href="crefsqlj34834.dita#crefsqlj34834">SQL92Identifier</xref></i></b></codeblock></example>

Modified: db/derby/docs/trunk/src/ref/rrefdeclaretemptable.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefdeclaretemptable.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefdeclaretemptable.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefdeclaretemptable.dita Fri Sep 22 09:46:58 2006
@@ -24,7 +24,8 @@
 table for the current connection. </shortdesc>
 <prolog><metadata>
 <keywords><indexterm>DECLARE GLOBAL TEMPORARY TABLE statement</indexterm>
-<indexterm>tables<indexterm>temporary</indexterm></indexterm></keywords>
+<indexterm>tables<indexterm>temporary</indexterm></indexterm><indexterm><indexterm>SQL
+statements</indexterm>DECLARE GLOBAL TEMPORARY TABLE</indexterm></keywords>
 </metadata></prolog>
 <refbody>
 <section><p>These tables do not reside in the system catalogs and are not
@@ -58,12 +59,13 @@
 more information on <codeph>column-definition</codeph>. <codeph>DECLARE GLOBAL
 TEMPORARY TABLE</codeph> does not allow <codeph>generated-column-spec</codeph> in
 the <codeph>column-definition</codeph>.</p></section>
-<section id="rreftemptabledatatype"><title>Data type</title><p>Supported data types
-are: <ul>
+<section id="rreftemptabledatatype"><title>Data type</title><p>Supported data
+types are: <ul>
 <li>BIGINT</li>
 <li>CHAR</li>
 <li>DATE</li>
 <li>DECIMAL</li>
+<li>DOUBLE</li>
 <li>DOUBLE PRECISION</li>
 <li>FLOAT</li>
 <li>INTEGER</li>
@@ -126,34 +128,41 @@
 <li>PARTITIONING KEY</li>
 <li>WITH REPLACE </li>
 </ul> </p></section>
-<section><title>Restrictions on Declared Global Temporary Tables</title> <p>Temporary
+<section><title>Restrictions on Declared Global Temporary Tables</title> <p><ph
+conref="refconrefs.dita#prod/productshortname"></ph> does not support the
+following features on temporary tables. Some of these features are specific
+to temporary tables and some are specific to <ph conref="refconrefs.dita#prod/productshortname"></ph>.</p><p>Temporary
 tables cannot be specified in the following statements: <ul>
 <li>ALTER TABLE </li>
+<li>CREATE INDEX</li>
 <li>CREATE SYNONYM</li>
 <li>CREATE TRIGGER</li>
 <li>CREATE VIEW</li>
-<li>LOCK</li>
+<li>GRANT</li>
+<li>LOCK TABLE</li>
 <li>RENAME</li>
-</ul></p><p>Temporary tables cannot be specified in referential constraints.</p><p>There
-is no support for check constraints on columns.</p><p>The following data types
-cannot be used with Declared Global Temporary Tables: <ul>
+<li>REVOKE</li>
+</ul></p><p>You cannot use the following features with temporary tables:</p><ul>
+<li>Synonyms, triggers and views on SESSION schema tables (including physical
+tables and temporary tables) </li>
+<li>Caching statements that reference SESSION schema tables and views</li>
+<li>Temporary tables cannot be specified in referential constraints and primary
+keys</li>
+<li>Temporary tables cannot be referenced in a triggered-SQL-statement</li>
+<li>Check constraints on columns</li>
+<li>Generated-column-spec</li>
+<li>Importing into temporary tables</li>
+</ul> <p>If a statement that performs an insert, update, or delete to the
+temporary table encounters an error, all the rows of the temporary table are
+deleted.</p><p>The following data types cannot be used with Declared Global
+Temporary Tables: <ul>
 <li>BLOB</li>
+<li>CHAR FOR BIT DATA</li>
 <li>CLOB</li>
 <li>LONG VARCHAR</li>
+<li>LONG VARCHAR FOR BIT DATA</li>
+<li>VARCHAR FOR BIT DATA</li>
 <li>XML</li>
-</ul></p><p>Temporary tables cannot be referenced in a triggered-SQL-statement.</p><p>If
-a statement that performs an insert, update, or delete to the temporary table
-encounters an error, all the rows of the temporary table are deleted.</p></section>
-<section><title>Restrictions Specific to Derby</title> <p><ph conref="refconrefs.dita#prod/productshortname"></ph> does
-not support the following features on temporary tables:</p> <ul>
-<li>Indexes</li>
-<li>Synonyms, triggers and views on SESSION schema tables (including physical
-tables and temporary tables)</li>
-<li>LOCK TABLE</li>
-<li>Constraints and primary keys</li>
-<li>Generated-column-spec</li>
-<li>Importing into temporary tables</li>
-</ul> <p>Statements that reference SESSION schema tables and views are not
-cached.</p></section>
+</ul></p></section>
 </refbody>
 </reference>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj15446.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj15446.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj15446.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj15446.dita Fri Sep 22 09:46:58 2006
@@ -1,4 +1,6 @@
 <?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
@@ -15,19 +17,32 @@
 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="rrefsqlj15446" xml:lang="en-us">
 <title>CREATE VIEW statement</title>
 <prolog><metadata>
-<keywords><indexterm>CREATE VIEW statement</indexterm><indexterm>Views<indexterm>creating</indexterm></indexterm>
+<keywords><indexterm>CREATE VIEW statement</indexterm><indexterm><indexterm>SQL
+statements</indexterm>CREATE VIEW</indexterm><indexterm>views<indexterm>creating</indexterm></indexterm>
 </keywords>
 </metadata></prolog>
 <refbody>
 <section> <p>Views are virtual tables formed by a query. A view is a dictionary
-object that you can use until you drop it.</p> <p>Views are not updatable.</p> <p>If
-a qualified view name is specified, the schema name cannot begin with <i>SYS</i>.</p></section>
+object that you can use until you drop it. Views are not updatable.</p><p>If
+a qualified view name is specified, the schema name cannot begin with <i>SYS</i>.</p><p>The
+view owner automatically gains the SELECT privilege on the view. The SELECT
+privilege cannot be revoked from the view owner. The database owner automatically
+gains the SELECT privilege on the view and is able to grant this privilege
+to other users. The SELECT privilege cannot be revoked from the database owner.</p><p>The
+view owner can only grant the SELECT privilege to other users if the view
+owner also owns the underlying objects. </p><p>If the underlying objects that
+the view references are not owned by the view owner, the view owner must be
+granted the appropriate privileges. For example, if the authorization ID <codeph>user2</codeph> attempts
+to create a view called <codeph>user2.v2</codeph> that references table <codeph>user1.t1</codeph> and
+function <codeph>user1.f_abs()</codeph>, then <codeph>user2</codeph> must
+have the SELECT privilege on table <codeph>user1.t1</codeph> and the EXECUTE
+privilege on function <codeph>user1.f_abs()</codeph>. </p><p>The privilege
+to grant the SELECT privilege cannot be revoked. If a required privilege on
+one of the underlying objects that the view references is revoked, then the
+view is dropped.</p></section>
 <refsyn><title>Syntax</title> <codeblock><b>CREATE VIEW <i><xref href="rrefviewname.dita#rrefviewname">view-Name</xref></i>
     [ ( <i><xref href="rrefsimplecolumnname.dita#rrefsimplecolumnname">Simple-column-Name</xref></i> [, <i><xref
 href="rrefsimplecolumnname.dita#rrefsimplecolumnname">Simple-column-Name</xref></i>] * ) ]
@@ -68,4 +83,3 @@
 external scalar function  <i>SIN.</i></p> </section>
 </refbody>
 </reference>
-

Modified: db/derby/docs/trunk/src/ref/rrefsqlj24513.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj24513.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj24513.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj24513.dita Fri Sep 22 09:46:58 2006
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
+ 
 <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
  "../dtd/reference.dtd">
 <!-- 
@@ -20,18 +21,27 @@
 <reference id="rrefsqlj24513" xml:lang="en-us">
 <title>CREATE TABLE statement</title>
 <prolog><metadata>
-<keywords><indexterm>CREATE TABLE statement</indexterm><indexterm>Defaults</indexterm>
-<indexterm>Column defaults</indexterm></keywords>
+<keywords><indexterm>CREATE TABLE statement</indexterm><indexterm><indexterm>SQL
+statements</indexterm>CREATE TABLE</indexterm><indexterm>tables<indexterm>creating</indexterm></indexterm>
+</keywords>
 </metadata></prolog>
 <refbody>
 <section> <p>A CREATE TABLE statement creates a table. Tables contain columns
 and constraints, rules to which data must conform. Table-level constraints
 specify a column or columns. Columns have a data type and can specify column
-constraints (column-level constraints).</p><p>For information about constraints,
-see <xref href="rrefsqlj13590.dita#rrefsqlj13590"></xref>.</p><p>You can specify
-a default value for a column. A default value is the value to be inserted
-into a column if no other value is specified. If not explicitly specified,
-the default value of a column is NULL. See <xref href="rrefsqlj30540.dita#rrefsqlj30540/sqlj64478"></xref>.</p><p>You
+constraints (column-level constraints).</p><p>The table owner and the database
+owner automatically gain the following privileges on the table and are able
+to grant these privileges to other users:<ul>
+<li>INSERT</li>
+<li>SELECT</li>
+<li>REFERENCES</li>
+<li>TRIGGER</li>
+<li>UPDATE</li>
+</ul>These privileges cannot be revoked from the table and database owners.</p><p>For
+information about constraints, see <xref href="rrefsqlj13590.dita#rrefsqlj13590"></xref>.</p><p>You
+can specify a default value for a column. A default value is the value to
+be inserted into a column if no other value is specified. If not explicitly
+specified, the default value of a column is NULL. See <xref href="rrefsqlj30540.dita#rrefsqlj30540/sqlj64478"></xref>.</p><p>You
 can specify storage properties such as page size for a table by calling the <codeph>SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY</codeph> system
 procedure.</p><p>If a qualified table name is specified, the schema name cannot
 begin with <i>SYS</i>.</p></section>

Modified: db/derby/docs/trunk/src/ref/rrefsqlj31580.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj31580.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj31580.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj31580.dita Fri Sep 22 09:46:58 2006
@@ -1,4 +1,7 @@
 <?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
@@ -15,36 +18,37 @@
 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="rrefsqlj31580" xml:lang="en-us">
 <title>CREATE SCHEMA statement</title>
 <prolog><metadata>
-<keywords><indexterm>CREATE SCHEMA statement</indexterm><indexterm>Schemas<indexterm>creating</indexterm></indexterm>
+<keywords><indexterm>CREATE SCHEMA statement</indexterm><indexterm><indexterm>SQL
+statements</indexterm>CREATE SCHEMA</indexterm><indexterm>schemas<indexterm>creating</indexterm></indexterm>
 </keywords>
 </metadata></prolog>
 <refbody>
 <section> <p>A schema is a way to logically group objects in a single collection
 and provide a unique namespace for objects. </p></section>
-<refsyn><title>Syntax</title> <codeblock><b>CREATE SCHEMA <i><xref href="rrefschemaname.dita#rrefschemaname">schemaName</xref></i></b></codeblock> <p>The
-CREATE SCHEMA statement is used to create a schema. A schema name cannot exceed
-128 characters. Schema names must be unique within the database.</p> </refsyn>
-<example> <codeblock><b><ph>-- Create a schema for employee-related tables</ph>
-CREATE SCHEMA EMP;
-<ph>-- Create a schema for airline-related tables</ph>
-CREATE SCHEMA Flights
-<ph>-- Create a table called "Availability" in each schema</ph>
-CREATE TABLE FLIGHTS.AVAILABILITY
+<refsyn><title>Syntax</title> <codeblock><b>CREATE SCHEMA { [ <i><xref href="rrefschemaname.dita#rrefschemaname">schemaName</xref></i> AUTHORIZATION <i
+>user-name</i> ] | [ <i>schemaName</i> ] | 
+[ AUTHORIZATION <i>user-name</i> ] }</b>
+</codeblock> <p>The CREATE SCHEMA statement is used to create a schema. A
+schema name cannot exceed 128 characters. Schema names must be unique within
+the database.</p> </refsyn>
+<example><title>CREATE SCHEMA examples</title><p>To create a schema for airline-related
+tables and give the authorization ID <codeph>anita</codeph> access to all
+of the objects that use the schema, use the following syntax:<codeblock><b>CREATE SCHEMA FLIGHTS AUTHORIZATION anita</b> </codeblock></p><p>To
+create a schema employee-related tables, use the following syntax:<codeblock><b>CREATE SCHEMA EMP</b> </codeblock></p><p>To
+create a schema that uses the same name as the authorization ID <codeph>takumi</codeph>,
+use the following syntax:<codeblock><b>CREATE SCHEMA AUTHORIZATION takumi</b> </codeblock></p><p>To
+create a table called <codeph>availability</codeph> in the <codeph>EMP</codeph> and <codeph>FLIGHTS</codeph> schemas,
+use the following syntax:<codeblock><b>CREATE TABLE FLIGHTS.AVAILABILITY
 	(FLIGHT_ID CHAR(6) NOT NULL, SEGMENT_NUMBER INT NOT NULL,
 	FLIGHT_DATE DATE NOT NULL, ECONOMY_SEATS_TAKEN INT,
 	BUSINESS_SEATS_TAKEN INT, FIRSTCLASS_SEATS_TAKEN INT, 
 	CONSTRAINT FLT_AVAIL_PK
-	PRIMARY KEY (FLIGHT_ID, SEGMENT_NUMBER, FLIGHT_DATE));
-
-CREATE TABLE EMP.AVAILABILITY
+	PRIMARY KEY (FLIGHT_ID, SEGMENT_NUMBER, FLIGHT_DATE))</b> </codeblock></p><codeblock><b>CREATE TABLE EMP.AVAILABILITY
 	(HOTEL_ID INT NOT NULL, BOOKING_DATE DATE NOT NULL, ROOMS_TAKEN INT,
-	CONSTRAINT HOTELAVAIL_PK PRIMARY KEY (HOTEL_ID, BOOKING_DATE));</b></codeblock> </example>
+	CONSTRAINT HOTELAVAIL_PK PRIMARY KEY (HOTEL_ID, BOOKING_DATE))
+</b></codeblock> </example>
 </refbody>
 </reference>
-

Modified: db/derby/docs/trunk/src/ref/rrefsqlj40506.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj40506.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj40506.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj40506.dita Fri Sep 22 09:46:58 2006
@@ -1,4 +1,6 @@
 <?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
@@ -15,33 +17,33 @@
 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="rrefsqlj40506" xml:lang="en-us">
 <title>LOCK TABLE statement</title>
 <prolog><metadata>
-<keywords><indexterm>LOCK TABLE statement</indexterm><indexterm>Tables<indexterm>locking</indexterm></indexterm>
-<indexterm>Lock escalation<indexterm>by user</indexterm></indexterm></keywords>
+<keywords><indexterm>LOCK TABLE statement</indexterm><indexterm><indexterm>SQL
+statements</indexterm>LOCK TABLE</indexterm><indexterm>tables<indexterm>locking</indexterm></indexterm>
+<indexterm>lock escalation<indexterm>by user</indexterm></indexterm></keywords>
 </metadata></prolog>
 <refbody>
-<section> <p>Allows a user to explicitly acquire a shared or exclusive table
-lock on the specified table. The table lock lasts until the end of the current
-transaction. </p><p>Explicitly locking a table is useful for:   <ul>
-<li>avoiding the overhead of multiple row locks on a table (in other words,
-user-initiated lock escalation)</li>
-<li>avoiding deadlocks</li>
+<section> <p>The LOCK TABLE statement allows you to explicitly acquire a shared
+or exclusive table lock on the specified table. The table lock lasts until
+the end of the current transaction. </p><p>To lock a table, you must either
+be the database owner or the table owner.</p><p>Explicitly locking a table
+is useful to:   <ul>
+<li>Avoid the overhead of multiple row locks on a table (in other words, user-initiated
+lock escalation)</li>
+<li>Avoid deadlocks</li>
 </ul></p><p>You cannot lock system tables with this statement.</p></section>
 <refsyn><title>Syntax</title> <codeblock><b>LOCK TABLE <i><xref href="rreftablename.dita#rreftablename">table-Name</xref></i> IN { SHARE | EXCLUSIVE } MODE</b
 ></codeblock><p>Once a table is locked in either mode, a transaction does
-not acquire any subsequent row-level locks on a table. 
-For example, if a transaction locks the entire Flights table in share
-mode in order to read data, a particular statement might need to lock a particular
+not acquire any subsequent row-level locks on a table.  For example, if a
+transaction locks the entire <codeph>Flights</codeph> table in share mode
+in order to read data, a particular statement might need to lock a particular
 row in exclusive mode in order to update the row. However, the previous table-level
-lock on <i>Hotels</i> forces the exclusive lock to be table-level as well.</p><p>If
-the specified lock cannot be acquired because another connection already holds
-a lock on the table, a statement-level exception is raised (<i>SQLState</i> X0X02)
-after the deadlock timeout period.</p> </refsyn>
+lock on the <codeph>Hotels</codeph> table forces the exclusive lock to be
+table-level as well.</p><p>If the specified lock cannot be acquired because
+another connection already holds a lock on the table, a statement-level exception
+is raised (<i>SQLState</i> X0X02) after the deadlock timeout period.</p> </refsyn>
 <example><codeblock><b><ph>-- lock the entire table in share mode to avoid
 -- a large number of row locks</ph>
 LOCK TABLE Flights IN SHARE MODE;
@@ -78,4 +80,3 @@
 -- INSERT INTO PEOPLE . . .</b></codeblock> </example>
 </refbody>
 </reference>
-

Modified: db/derby/docs/trunk/src/ref/rrefsqlj43125.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqlj43125.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj43125.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj43125.dita Fri Sep 22 09:46:58 2006
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
- 
 <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
  "../dtd/reference.dtd">
 <!-- 
@@ -21,14 +20,14 @@
 <reference id="rrefsqlj43125" xml:lang="en-us">
 <title>CREATE TRIGGER statement</title>
 <prolog><metadata>
-<keywords><indexterm>CREATE TRIGGER statement</indexterm><indexterm>Triggers<indexterm>creating</indexterm></indexterm>
-<indexterm>Triggers<indexterm>defining when they fire</indexterm></indexterm>
-<indexterm>Triggers<indexterm>and database events</indexterm></indexterm>
-<indexterm>Triggers<indexterm>and the referencing clause</indexterm><indexterm>referencing
-old and new values</indexterm></indexterm><indexterm>Triggers<indexterm>statement
-versus row triggers</indexterm></indexterm><indexterm>Triggers<indexterm>the
-triggered-SQL-statement</indexterm></indexterm><indexterm>Triggers<indexterm>order
-of execution</indexterm></indexterm><indexterm>Triggers<indexterm>and recursion</indexterm></indexterm>
+<keywords><indexterm>CREATE TRIGGER statement</indexterm><indexterm>SQL statements<indexterm>CREATE
+TRIGGER</indexterm></indexterm><indexterm>triggers<indexterm>creating</indexterm></indexterm>
+<indexterm>triggers<indexterm>defining when they fire</indexterm></indexterm>
+<indexterm>triggers<indexterm>database events</indexterm></indexterm><indexterm>triggers<indexterm>referencing
+clause</indexterm><indexterm>referencing old and new values</indexterm></indexterm>
+<indexterm>triggers<indexterm>statement versus row triggers</indexterm></indexterm>
+<indexterm>triggers<indexterm>triggered-SQL-statement</indexterm></indexterm>
+<indexterm>triggers<indexterm>order of execution</indexterm></indexterm><indexterm>triggers<indexterm>recursion</indexterm></indexterm>
 </keywords>
 </metadata></prolog>
 <refbody>
@@ -42,13 +41,16 @@
 other tables, sending e-mail, and other useful actions.</p><p>You can define
 any number of triggers for a single table, including multiple triggers on
 the same table for the same event.</p><p>You can create a trigger in any schema
-except one that starts with <i>SYS</i>. The trigger need not reside in the
-same schema as the table on which it is defined.</p><p>If a qualified trigger
-name is specified, the schema name cannot begin with <i>SYS</i>.</p></section>
+where you are the schema owner. To create a trigger on a table that you do
+not own, you must be granted the TRIGGER privilege on that table. The database
+owner can also create triggers on any table in any schema.</p><p>The trigger
+does not need to reside in the same schema as the table on which the trigger
+is defined.</p><p>If a qualified trigger name is specified, the schema name
+cannot begin with <i>SYS</i>.</p></section>
 <refsyn id="syn001"><title>Syntax</title><codeblock><b>CREATE TRIGGER <i><xref
 href="rreftriggername.dita#rreftriggername">TriggerName</xref></i>
 { AFTER | NO CASCADE BEFORE } 
-{ INSERT | DELETE | UPDATE } [ OF <i>column-Name</i> [, <i><xref href="rrefcolumnname.dita#rrefcolumnname">column-Name</xref></i>]* ]
+{ INSERT | DELETE | UPDATE [ OF <i>column-Name</i> [, <i><xref href="rrefcolumnname.dita#rrefcolumnname">column-Name</xref></i>]* ] }
 ON <i><xref href="rreftablename.dita#rreftablename">table-Name</xref></i>
 [ <i><xref href="rrefsqlj89752.dita#rrefsqlj89752">ReferencingClause</xref></i> ]
 FOR EACH { ROW | STATEMENT } MODE DB2SQL 

Modified: db/derby/docs/trunk/src/ref/rrefsqljgrant.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljgrant.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljgrant.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqljgrant.dita Fri Sep 22 09:46:58 2006
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
- 
 <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
  "reference.dtd">
 <!-- 
@@ -35,9 +34,11 @@
 <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>
-</ul></p><p>When a table, view, function, or procedure is created, only the
-object owner has full privileges on the object. No other users have any privileges
-on the object until the object owner grants privileges to the users. </p><p>The
+</ul></p><p>Before you issue a GRANT statement, check that the <codeph>derby.database.sqlAuthorization</codeph> property
+is set to <codeph>true</codeph>. The <codeph>derby.database.sqlAuthorization</codeph> property
+enables the SQL Authorization mode.</p><p>You can grant privileges to database
+objects that you are authorized to grant. See the 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.</p></section>
 <section><title>Syntax for tables</title><codeblock><b>GRANT <i><xref href="rrefsqljgrant.dita#rrefsqljgrant/grantprivtype">privilege-type</xref></i
@@ -70,7 +71,8 @@
 to create a trigger on the specified table.</p><p>Use the UPDATE privilege
 type to grant permission to use the UPDATE statement on the specified table.
 If a column list is specified, the permission applies only to the specified
-columns.</p></section>
+columns. To update a row using a statement that includes a WHERE clause, you
+must have SELECT permission on the columns in the row that you want to update. </p></section>
 <section id="grantgrantees"><title>grantees</title><codeblock><b>{	<i>authorization ID</i> | PUBLIC } [,{ <i>authorization ID</i> | PUBLIC } ] *</b
 ></codeblock><p>You can grant privileges for specific users or for all users.
 Use the keyword PUBLIC to specify all users. When PUBLIC is specified, the

Modified: db/derby/docs/trunk/src/ref/rrefsqljrenametablestatement.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljrenametablestatement.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljrenametablestatement.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqljrenametablestatement.dita Fri Sep 22 09:46:58 2006
@@ -1,4 +1,6 @@
 <?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
@@ -15,17 +17,17 @@
 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="rrefsqljrenamestatements" xml:lang="en-us">
 <title>RENAME TABLE statement </title>
 <prolog><metadata>
-<keywords><indexterm>RENAME TABLE statement</indexterm></keywords>
+<keywords><indexterm>RENAME TABLE statement</indexterm><indexterm><indexterm>SQL
+statements</indexterm>RENAME TABLE</indexterm><indexterm><indexterm>tables</indexterm>renaming</indexterm>
+</keywords>
 </metadata></prolog>
 <refbody>
 <section> <p>RENAME TABLE allows you to rename an existing table in any schema
-(except the schema <i>SYS</i>).</p></section>
+(except the schema <i>SYS</i>). </p><p>To rename a table, you must either
+be the database owner or the table owner.</p></section>
 <refsyn><title>Syntax</title> <codeblock><b>RENAME TABLE <i>table-Name</i> TO <i><xref
 href="rrefnewtablename.dita#rrefnewtablename">new-Table-Name</xref></i></b></codeblock> <p>If
 there is a view or foreign key that references the table, attempts to rename
@@ -33,10 +35,9 @@
 or triggers on the table, attempts to rename it will also generate an error.</p> </refsyn>
 <example> <codeblock><b>RENAME TABLE SAMP.EMP_ACT TO EMPLOYEE_ACT</b></codeblock> <p>Also
 see <xref href="rrefsqlj81859.dita#rrefsqlj81859"></xref> for more information.</p> </example>
-<section><title>Statement dependency system</title> <p>If there
-is an index defined on the table, the table can be renamed.</p> <p>RENAME
-TABLE is not allowed if there are any open cursors that reference the table
-being altered.</p> </section>
+<section><title>Statement dependency system</title> <p>If there is an index
+defined on the table, the table can be renamed.</p> <p>The RENAME TABLE statement
+is not allowed if there are any open cursors that reference the table that
+is being altered.</p> </section>
 </refbody>
 </reference>
-

Modified: db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita?view=diff&rev=448987&r1=448986&r2=448987
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqljrevoke.dita Fri Sep 22 09:46:58 2006
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
- 
 <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
  "reference.dtd">
 <!--
@@ -29,7 +28,7 @@
 </metadata></prolog>
 <refbody>
 <section> <p>The following types of permissions can be revoked:<ul>
-<li>Delete a specific table.</li>
+<li>Delete data from a specific table.</li>
 <li>Insert data into a specific table.</li>
 <li>Create a foreign key reference to the named table or to a subset of columns
 from a table.</li>
@@ -37,7 +36,10 @@
 <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>
-</ul></p><p>Only the owner of an object can revoke privileges from an object.</p><p>The
+</ul></p><p>Before you issue a REVOKE statement, check that the <codeph>derby.database.sqlAuthorization</codeph> property
+is set to <codeph>true</codeph>. The <codeph>derby.database.sqlAuthorization</codeph> property
+enables the SQL Authorization mode.</p><p>You can revoke privileges from an
+object if you are the owner of the object or the database owner.</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.</p></section>
 <section><title>Syntax for tables</title><codeblock><b>REVOKE <i><xref href="rrefsqljrevoke.dita#rrefsqljrevoke/revokeptype">privilege-type</xref