MSCEWI3050
UDF was transformed to Snowflake procedure, calling procedures inside a query is not supported.
This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.
Severity
High
Description
This error is added when a call to a UDF (user defined function) is found inside a query. Oracle UDFs and UDFs inside packages are being transformed to Snowflake Stored Procedures, which can not be called from a query.
The function is transformed to a Stored procedure to maintain functional equivalence and the function call is transformed to an empty Snowflake UDF function.
Example Code
Input Code:
Declaration
-- Create Function
CREATE OR REPLACE FUNCTION FUN1(PAR1 VARCHAR)
RETURN VARCHAR
IS
VAR1 VARCHAR(20);
BEGIN
SELECT COL1 INTO VAR1 FROM TABLE1 where col1 = 1;
RETURN VAR1;
END;
/
--Function inside package
CREATE OR REPLACE PACKAGE BODY pkg1 AS
FUNCTION f1(x NUMBER) RETURN NUMBER IS
VAR1 NUMBER;
BEGIN
SELECT ID INTO VAR1 FROM TABLE1 WHERE ID = 1;
RETURN 1;
END f1;
END pkg1;
/Call
Output Code:
Call
Recommendations
If you need more support, you can email us at [email protected]
Last updated
