forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
40 lines
3.3 KiB
HTML
40 lines
3.3 KiB
HTML
<a name="mrs_01_24501"></a><a name="mrs_01_24501"></a>
|
|
|
|
<h1 class="topictitle1">Changing a Table Name</h1>
|
|
<div id="body0000001534674982"><div class="section" id="mrs_01_24501__en-us_topic_0265792790_sa1cb229bf26b4a7a8efd1716defb63de"><h4 class="sectiontitle">Function</h4><p id="mrs_01_24501__en-us_topic_0265792790_ac917e6d6e78044e99179c0e0f5284232">The <strong id="mrs_01_24501__b202471117185112">ALTER TABLE ... RENAME</strong> command is used to change the table name.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_24501__en-us_topic_0265792790_sc019b10a59e9426498a678c024d74f03"><h4 class="sectiontitle">Syntax</h4><p id="mrs_01_24501__p115411424114818"><strong id="mrs_01_24501__b5541132404813">ALTER TABLE<em id="mrs_01_24501__i1128416191333"> </em></strong><em id="mrs_01_24501__i6285131912332">tableName </em><strong id="mrs_01_24501__b1645411281331">RENAME TO</strong><em id="mrs_01_24501__i198381232337"> newTableName</em></p>
|
|
</div>
|
|
<div class="section" id="mrs_01_24501__en-us_topic_0265792790_s253f086de08745ac890027c0b103cd7a"><h4 class="sectiontitle">Parameter Description</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_24501__en-us_topic_0265792790_ta69e9ecdc1554375a8a1e844b14e00c5" frame="border" border="1" rules="all"><caption><b>Table 1 </b>RENAME parameters</caption><thead align="left"><tr id="mrs_01_24501__en-us_topic_0265792790_r61ddb6139b8d4f4ca4a88c6389f8f327"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.3.2.2.3.1.1"><p id="mrs_01_24501__en-us_topic_0265792790_aeb0bfa560fb74f1f9e584cc1ef05bb9b">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.3.2.2.3.1.2"><p id="mrs_01_24501__en-us_topic_0265792790_ae81789e97e6d4953a8342f22d64feea9">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_24501__en-us_topic_0265792790_r4a578c7015ba461bab46a5c40c46256a"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_24501__en-us_topic_0265792790_ac25da7f69c964d93947693ed5b4006cb">tableName</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_24501__en-us_topic_0265792790_a09288a5af7f44e36922b37de34446d94">Table name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_24501__row8907155215817"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.3.2.2.3.1.1 "><p id="mrs_01_24501__p89092524588">newTableName</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.3.2.2.3.1.2 "><p id="mrs_01_24501__p590945210588">New table name.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="mrs_01_24501__en-us_topic_0265792790_s55536c9c534643ed8272f9f4b47fb407"><h4 class="sectiontitle">Example</h4><pre class="screen" id="mrs_01_24501__screen158063184013">ALTER TABLE table1 RENAME TO table2</pre>
|
|
</div>
|
|
<div class="section" id="mrs_01_24501__en-us_topic_0265792790_sbd5eea8637c94038bf6a129ab9ca129f"><h4 class="sectiontitle">Response</h4><p id="mrs_01_24501__en-us_topic_0265792790_ab3f2ebd199c342fb9103cbe4f02c7148">You can run the <strong id="mrs_01_24501__b15741155124820">SHOW TABLES</strong> command to view the new table name.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_24495.html">SparkSQL Schema Evolution and Syntax Description</a></div>
|
|
</div>
|
|
</div>
|
|
|