From derby-commits-return-5690-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Thu Nov 09 17:54:18 2006 Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 51474 invoked from network); 9 Nov 2006 17:54:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Nov 2006 17:54:17 -0000 Received: (qmail 34396 invoked by uid 500); 9 Nov 2006 17:54:28 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 34372 invoked by uid 500); 9 Nov 2006 17:54:28 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 34359 invoked by uid 99); 9 Nov 2006 17:54:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Nov 2006 09:54:28 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Nov 2006 09:54:16 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8467C1A9846; Thu, 9 Nov 2006 09:53:48 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r472990 - in /db/derby/docs/trunk/src/ref: crefsqljrenamestatements.dita refderby.ditamap rrefsqljrenamecolumnstatement.dita Date: Thu, 09 Nov 2006 17:53:48 -0000 To: derby-commits@db.apache.org From: bpendleton@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061109175348.8467C1A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bpendleton Date: Thu Nov 9 09:53:47 2006 New Revision: 472990 URL: http://svn.apache.org/viewvc?view=rev&rev=472990 Log: DERBY-2042: Provide documentation for RENAME COLUMN statement This change adds a new page to the reference guide, in the section on RENAME statements, describing the new RENAME COLUMN statement. Added: db/derby/docs/trunk/src/ref/rrefsqljrenamecolumnstatement.dita (with props) Modified: db/derby/docs/trunk/src/ref/crefsqljrenamestatements.dita db/derby/docs/trunk/src/ref/refderby.ditamap Modified: db/derby/docs/trunk/src/ref/crefsqljrenamestatements.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/crefsqljrenamestatements.dita?view=diff&rev=472990&r1=472989&r2=472990 ============================================================================== --- db/derby/docs/trunk/src/ref/crefsqljrenamestatements.dita (original) +++ db/derby/docs/trunk/src/ref/crefsqljrenamestatements.dita Thu Nov 9 09:53:47 2006 @@ -21,7 +21,7 @@ RENAME statements -

Use the Rename statements with indexes and tables.

+

Use the Rename statements with indexes, columns, and tables.

Modified: db/derby/docs/trunk/src/ref/refderby.ditamap URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/refderby.ditamap?view=diff&rev=472990&r1=472989&r2=472990 ============================================================================== --- db/derby/docs/trunk/src/ref/refderby.ditamap (original) +++ db/derby/docs/trunk/src/ref/refderby.ditamap Thu Nov 9 09:53:47 2006 @@ -147,6 +147,7 @@ + Added: db/derby/docs/trunk/src/ref/rrefsqljrenamecolumnstatement.dita URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljrenamecolumnstatement.dita?view=auto&rev=472990 ============================================================================== --- db/derby/docs/trunk/src/ref/rrefsqljrenamecolumnstatement.dita (added) +++ db/derby/docs/trunk/src/ref/rrefsqljrenamecolumnstatement.dita Thu Nov 9 09:53:47 2006 @@ -0,0 +1,70 @@ + + + + + RENAME COLUMN statement +Use the RENAME COLUMN statement to rename a column in a table. + +RENAME COLUMN statement +SQL statementsRENAME COLUMN +columnsrenaming + + + +

The RENAME COLUMN statement allows you to rename an existing +column in an existing table in any schema +(except the schema SYS).

To rename a column, you must either +be the database owner or the table owner.

+

Other types of table alterations are possible; +see +for more information.

+
+Syntax + RENAME COLUMN table-Name.simple-Column-Name TO simple-Column-Name + + +Examples +

To rename the manager column in table employee to +supervisor, use the following syntax: +RENAME COLUMN EMPLOYEE.MANAGER TO SUPERVISOR +

+

You can combine ALTER TABLE and RENAME COLUMN to modify a column's data +type. To change column c1 of table t to the +new data type NEWTYPE: + + ALTER TABLE t ADD COLUMN c1_newtype NEWTYPE + UPDATE t SET c1_newtype = c1 + ALTER TABLE t DROP COLUMN c1 + RENAME COLUMN t.c1_newtype TO c1 +

+
+
Usage notes +If there is a view, trigger, check constraint, or +foreign key constraint that references the column, attempts to rename it +will generate an error. + +The RENAME COLUMN statement +is not allowed if there are any open cursors that reference the column that +is being altered. +If there is an index +defined on the column, the column can still be renamed; the index is +automatically updated to refer to the column by its new name +
+
+
Propchange: db/derby/docs/trunk/src/ref/rrefsqljrenamecolumnstatement.dita ------------------------------------------------------------------------------ svn:eol-style = native