SSC-EWI-OR0109

Expressions as arguments of Using Clause are not supported by Snowflake Scripting

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Severity

Medium

Description

Oracle supports using expressions as arguments to any USING Clause for the EXECUTE IMMEDIATE statements. This functionality is not supported by Snowflake Scripting.

Snowflake Scripting does support variable expressions, and this it is possible to replace the expression by manually assigning it to a variable (see example below).

Example Code

Input Code:

IN -> Oracle_01.sql
CREATE OR REPLACE PROCEDURE expression_arguments
IS
  immediate_input INTEGER := 0;
BEGIN
  EXECUTE IMMEDIATE 'INSERT INTO immediate_table VALUES (:value)' USING immediate_input+1;
END;

Output Code:

Manually migrated Execute Immediate procedure:

Replacing this procedure with the one above will solve the compilation error, and yield the same results as Oracle.

Recommendations

  • Procedures can be manually migrated by adding a variable and then assigning the expression to said variable.

  • If you need more support, you can email us at [email protected]

Last updated