db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
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 GMT
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 @@
 <concept id="crefsqljrenamestatements" xml:lang="en-us">
 <title>RENAME statements</title>
 <conbody>
-<p>Use the Rename statements with indexes and tables.</p>
+<p>Use the Rename statements with indexes, columns, and tables.</p>
 </conbody>
 </concept>
 

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 @@
 <topicref href="rrefsqlj95598.dita" navtitle="RENAME INDEX statement"></topicref>
 <topicref href="rrefsqljrenametablestatement.dita" navtitle="RENAME TABLE statement ">
 </topicref>
+<topicref href="rrefsqljrenamecolumnstatement.dita" navtitle="RENAME COLUMN statement
"/>
 </topicref>
 <topicref href="rrefsqljrevoke.dita" navtitle="REVOKE statement"></topicref>
 <topicref collection-type="family" href="crefsqlj35312.dita" navtitle="SET statements">

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 @@
+<?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="rrefsqljrenamestatements" xml:lang="en-us">
+    <title>RENAME COLUMN statement </title>
+<shortdesc>Use the RENAME COLUMN statement to rename a column in a table.</shortdesc>
+<prolog><metadata>
+<keywords><indexterm>RENAME COLUMN statement</indexterm>
+<indexterm><indexterm>SQL statements</indexterm>RENAME COLUMN</indexterm>
+<indexterm><indexterm>columns</indexterm>renaming</indexterm>
+</keywords>
+</metadata></prolog>
+<refbody>
+<section> <p>The RENAME COLUMN statement allows you to rename an existing 
+column in an existing table in any schema
+(except the schema <i>SYS</i>). </p><p>To rename a column, you must
either
+be the database owner or the table owner.</p>
+<p>Other types of table alterations are possible;
+see <xref href="rrefsqlj81859.dita#rrefsqlj81859"></xref>
+for more information.</p>
+</section>
+<refsyn><title>Syntax</title>
+    <codeblock><b>RENAME COLUMN <i><xref href="rreftablename.dita">table-Name</xref></i>.<i><xref
href="rrefsimplecolumnname.dita">simple-Column-Name</xref></i> TO <i><xref
href="rrefsimplecolumnname.dita">simple-Column-Name</xref></i></b></codeblock>
+</refsyn>
+<example id="renamecolumnexamples">
+<title>Examples</title>
+<p>To rename the <i>manager</i> column in table <i>employee</i>
to
+<i>supervisor</i>, use the following syntax:
+<codeblock><b>RENAME COLUMN EMPLOYEE.MANAGER TO SUPERVISOR</b></codeblock>
+</p>
+<p>You can combine ALTER TABLE and RENAME COLUMN to modify a column's data
+type. To change column <i>c1</i> of table <i>t</i> to the
+new data type <i>NEWTYPE</i>:
+<codeblock><b>
+    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
+</b></codeblock></p>
+</example>
+<section><title>Usage notes</title>
+<note id="restriction">If there is a view, trigger, check constraint, or
+foreign key constraint that references the column, attempts to rename it
+will generate an error.
+</note>
+<note id="restriction">The RENAME COLUMN statement
+is not allowed if there are any open cursors that reference the column that
+is being altered.</note>
+<note>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</note>
+</section>
+</refbody>
+</reference>

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



Mime
View raw message