Open GeMa300 opened 3 weeks ago
From testing and the snowflake query log: It appears that all single quotes in the heredoc get converted to \'
in the SDK. The snowflake query will then turn around and convert every \'
to ''
.
Hey @GeMa300. Thanks for reaching out to us.
The procedure resource will be redesigned as part of https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#preparing-essential-ga-objects-for-the-provider-v1. I will link this issue to https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/v1-preparations/ESSENTIAL_GA_OBJECTS.MD. As a workaround, you can use unsafe_execute.
Terraform CLI Version
1.9.1
Terraform Provider Version
0.92.0
Terraform Configuration
Category
category:resource
Object type(s)
resource:procedure
Expected Behavior
The given procedure should be available in Snowflake with the line
v_sql_statement:= 'SHOW GRANTS TO USER "' || :v_username || '";';
Actual Behavior
The provider adds single quotes to every single quote, rendering the SQL procedure useless.
v_sql_statement:= ''SHOW GRANTS TO USER "'' || :v_username || ''";'';
Steps to Reproduce
How much impact is this issue causing?
High
Logs
No response
Additional Information
No response
Would you like to implement a fix?