Purpose
You can use this statement to rename a table, view, private synonym, or sequence.
Syntax
RENAME obj_name TO new_obj_name;
Parameters
| Parameter | Description |
|---|---|
| obj_name | The original object name. |
| new_obj_name | The new object name. The new object name cannot be already used by another object. |
Examples
Create a table named tbl1 and rename tbl1 as tbl2.
obclient> CREATE TABLE tbl1(col1 INT,col2 INT);
Query OK, 0 rows affected
obclient> RENAME tbl1 TO tbl2;
Query OK, 0 rows affected