Create a table name without back tick when using set variable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 11:01 AM
When i tried to create a table name with variable like this
-- Set a string variable
SET table_suffix = 'suffix';
-- Use dynamic SQL to create a table with the variable as a suffix in the table name
CREATE TABLE IF NOT EXISTS <dbname>.my_table_${table_suffix} (
id INT,
name STRING,
age INT
)
I could able to fetch the data from this table like this.
select * from gmi_im.my_table_`suffix`
But I need it without back ticks . Is there any po way?