In an Azure Data Factory pipeline I have an Activity Script that is executing an SQL statement on Snowflake. Everything works fine until I begin to use a script parameter in my statement, resulting in the statement encountering a syntax error. The SQL I'm trying to execute is:
USE ROLE ?
According to the tooltip for the script parameters, the tool says: "For Oracle and Snowflake connectors, only positional parameter is supported. Use "?" as placeholders in the query for the parameter. The order of "?" needs to match the order of the provided parameters below.". However no matter what I try in my statement, I always seem to get a syntax error: ERROR [42000] SQL compilation error: syntax error line 1 at position 9 unexpected '?'.
Can someone offer any advice as to what I am doing wrong? Below is a screenshot of the SQL being execute, the single parameter, and the variations I have already tried to get this to work with no success:
- Using a ? or "?" in the SQL without the script parameter named.
- Using a ? or "?" in the SQL with the script parameter named either: Param1 or ?.
- Using a @Param1 in the SQL with the parameter named Param1.
The Example Script that Errors
