Purpose
This statement is used to rename a table, view, materialized view, private synonym, or sequence.
Syntax
RENAME object_name TO new_object_name;
Parameters
| Parameter | Description |
|---|---|
| object_name | The name of the object to be renamed. This can be a table, view, materialized view, private synonym, or sequence. |
| new_object_name | The new name of the object. The new name must not be the same as the name of an existing object. |
Examples
Create a table named
tbl1.obclient> CREATE TABLE tbl1(col1 INT, col2 INT);Rename the table
tbl1totbl2.obclient> RENAME tbl1 TO tbl2;