I am trying to load table names into variable and then use the variable in a DDL statement to change the name of the table.
The DDL statement is:
alter table db_name.schema_name.${table_name} rename to db_name.schema_name..${table_name}_RENAME
So if I have a table name: 'Abc', it changes to 'ABC' once passed into the variable. Therefore the DDL statement gives below error:
SQL compilation error:
Table 'dn_name.schema_name.ABC' does not exist or not authorized.
How do I fix this?