MSCEWI1087

Arguments do not match the called procedure parameters count, default parameters are not supported yet

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Severity

Low

Description

This warning appears when the arguments provided to a procedure call, do not match the total number of the procedure parameters. This is usual behavior when the procedure is using default / optional parameters.

In Snowflake, optional parameters are not supported.

Example Code

Input Code:

CREATE OR REPLACE PROCEDURE proc_1(param1 NUMBER, param2 NUMBER DEFAULT 5)
IS
    var1 NUMBER;
BEGIN
    var1 := param1 + param2;
END;

CREATE OR REPLACE PROCEDURE proc_calling_proc_1
IS
    var1 NUMBER;
BEGIN
    var1 := 10;
    proc_1(var1);
END;   

Output Code:

CREATE OR REPLACE PROCEDURE PUBLIC.proc_1 (param1 NUMBER (38,18), param2 NUMBER (38,18))
RETURNS VARCHAR
LANGUAGE SQL
EXECUTE AS CALLER
AS
$$
    DECLARE
            var1 NUMBER (38,18);
    BEGIN
            var1 := :param1 + :param2;
    END;
$$;

CREATE OR REPLACE PROCEDURE PUBLIC.proc_calling_proc_1 ()
RETURNS VARCHAR
LANGUAGE SQL
EXECUTE AS CALLER
AS
$$
    DECLARE
            var1 NUMBER (38,18);
    BEGIN
            var1 := 10;
            /*** MSC-WARNING - MSCEWI1087 - ARGUMENTS DO NOT MATCH THE CALLED PROCEDURE PARAMETERS COUNT, DEFAULT PARAMETERS ARE NOT SUPPORTED YET ***/
            CALL PUBLIC.proc_1(:var1);
    END;
$$;

Recommendations

  • Missing parameters can be added manually with the default value of the procedure declaration.

This process is already being done for some languages and will be available soon for all the converters.

Last updated