MSCEWI1068

User defined function was transformed to a Snowflake procedure.

triangle-exclamation

Severity

Low

Description

Snowflake user defined functions do not support the same features as Oracle or SQL Server. To maintain the functional equivalence the function is transformed to a Snowflake stored procedure. This will affect their usage in queries.

Example Code

1. Scalar Return Type

Input Code:

CREATE OR REPLACE FUNCTION FUNC01(x NUMBER) RETURN NUMBER AS
  VAR1 NUMBER;
  BEGIN
   -- some pl sql statements
   RETURN VAR1;
  END FUNC01;

Output Code:

2. Table-Valued return type

Input code from SQL Server:

Output code:

Recommendations

  • Separate the queries to maintain the same logic as in the example below.

Input code from SQL Server:

Output code:

Last updated