RENAME tablename, newname

The syntax above renames a table.

  • tablename: The name of the table with full path.
  • newname: The desired name.

Practical example

Command:

RENAME table01.table10, renamedtable

Output:

RENAMETABLE ::base => TABLE01.TABLE10, new => RENAMEDTABLE



RENAME tablename[newname]

The syntax above renames a table. Use this expression when there are commas either in table name or in new name.

  • tablename: The name of the table with full path.
  • newname: The desired name.

Practical example

Command:

RENAME table01.table10[renamed, table]

Output:

RENAMETABLE ::base => TABLE01.TABLE10, new => RENAMED, TABLE



In case if you rename multiple tables to one common name the result will be an aggregated view. The same as described in the ASSIGN page.