RENAME

RENAME tablename TO newtablename

Renames a database table. Associated indices are automatically renamed.

If the table is partitioned then all the component partitions are also renamed. You cannot rename individual partitions. When renaming a partitions KCML uses the following rule to determine where the partition number should be inserted in the new name:

For example if table A contains two partitions thus

	A_0001
	A_0002

then renaming to B would result is these partition names:

RENAME A TO B
	B_0001
	B_0002

and renaming to B_01_table would result is these partition names:

RENAME A TO B
	B_01_table_0001
	B_01_table_0002

but if renamed to B_01_table_AA-BB then the _AA-BB will be considered a suffix and the partitions will be:

RENAME A TO "B_01_table_AA-BB"
	B_01_table_0001_AA-BB
	B_01_table_0002_AA-BB

Note that table names containing non-standard characters, such as a minus sign, must be quoted in SQL.