This article will cover the syntax of the ‘Rename Table’ regular script statement.
This statement allows specified tables to be renamed.
Statement syntax
Rename Table | Tables using mapname | oldname to newname{ , oldname to newname }
Table | Tables | Single or multiple tables can be specified with the rename statement. |
Using Mapname | The tables can be renamed using a previously created map. |
Oldname to Newname | If not using a map, tables and their new names can be specified in a comma separated list. |
Example
The table ‘CUSTOMERS’ is renamed to a more specific name.
CUSTOMERS:
LOAD
id,
firstName,
lastName,
email,
dob
FROM [lib://Public:DataFiles/customers.xlsx]
(ooxml, embedded labels, table is Sheet1);
Rename table CUSTOMERS to PRODUCT_X_CUSTOMERS;
Result
The ‘CUSTOMERS’ table is loaded and renamed to the specified name.