Show TOC

RENAME TABLE Statement (rename_table_statement)Locate this document in the navigation structure

Use

The RENAME TABLE statement ( rename_table_statement) changes the name of a base table.

Structure
				
<rename_table_statement>::=
  RENAME TABLE <old_table_name> TO <new_table_name>

<old_table_name>::=
  <table_name>

<new_table_name>::=
  <table_name>
				
			

Examples

SQL Tutorial, Tables

Explanation

If a schema name is not specified in the table name, the current schema is used. The old table name must identify a base table that is not a temporary table.

The current database user must have the CREATEIN privilege in the schema identified by new_table_name.

The new table name must not already be assigned to a base or view table or a private synonym in the schema identified by  new_table_name.

The old table old_table_name is assigned the name specified in new_table_name. All of the properties of the table (such as privileges, indexes) remain unchanged. The definitions of view tables based on the old table name are adapted to the new name.

More Information