Reputation: 11
I've to create a table in snowflake from snowsql with the current date like "test_202108" where 2021 is year & 08 is month.
I'm automating the process using shell script. Like creation of table, put & copy commands.
Can anyone please help me on that.
Thanks Pavan Kumar
Upvotes: 0
Views: 64
Reputation: 1642
You can test the following : Set a variable which is concatenation of year and month:
set value= (select 'table'||year(current_date()))||(select month(current_date()));
and with this use identifier keyword to reference the variable in the following :
CREATE table identifier($value) (col integer);
Upvotes: 1