Was this helpful?
RENAME TABLE
Valid in: SQL, ESQL, OpenAPI, ODBC, JDBC, .NET
This statement renames tables. (For an alternative method of renaming tables, see ALTER TABLE.)
The RENAME TABLE statement has the following format:
[EXEC SQL] RENAME TABLE [schema.]tablename TO new_tablename
Indexes, grants, comments, synonyms, sequences, partitions, and extension tables are automatically transferred to the newly renamed table or column.
The rename operation will fail with an error if any views, procedures, referential or check constraints, rules, integrities, non-grant permits, or security alarms have dependencies on the old table name.
Any forms, join definitions, or reports that refer to the old table name will be invalidated; these must be recreated and reloaded. Any copydb (unloaddb) scripts generated before renaming the table can no longer be used for reload operations.
For more information, see Rules and Restrictions on Renaming Tables).
Last modified date: 01/30/2023