I need some inputs on how to read the values of a column and make them available for forming a SQL and executing in Snowflake.
Multiple values are present in the table "all_resource_monitor_master"
SELECT 'RM'||'_'||rm_type||'_'||env INTO lv_rm_name FROM all_resource_monitor_master; ---> The o/p of this can be stored in a table.
<My loop starts based on lv_rm_name>
rm_setup := 'CREATE RESOURCE MONITOR IF NOT EXISTS ' || ' ' || '"' || <lv_rm_name> || '"' || ' ' || 'WITH' || ' '
|| 'CREDIT_QUOTA = ' || ' ' || lv_credit_quota || ' '
|| 'FREQUENCY = ' || ' ' || '"' || lv_frequency || '"' || ' '
|| 'START_TIMESTAMP = ' || ' ' || '"' || lv_timestamp || '"'|| ' '
|| 'NOTIFY_USERS = ' || '(' || '"' || lv_notify_users || '"' || ')' || ' '
|| 'TRIGGERS ON ' || lv_trigger1 || ' ' || 'PERCENT DO ' || ' ' || lv_action1 || ' '
|| 'ON ' || lv_trigger2 || ' ' || 'PERCENT DO ' || ' ' || lv_action2 || ' '
|| 'ON ' || lv_trigger3 || ' ' || 'PERCENT DO ' || ' ' || lv_action3 || ' ';
execute immediate :rm_setup;
<My loop ends based on lv_rm_name>
Please do share the inputs on how to achieve this functionality by using the loops.