MSCEWI3112

DBMS_RANDOM.VALUE Built-In Package precision is lower in Snowflake

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

Severity

Low

Description

This message is shown when SnowConvert migrates a DBMS_RANDOM.VALUE Oracle built-in package function. This warning indicates that the UDF added to emulate the functionality has lower precision than the original function.

Example code

Input Code:

CREATE OR REPLACE PROCEDURE built_in_package_proc
IS
var1 NUMBER;
BEGIN
    SELECT DBMS_RANDOM.VALUE() INTO var1 FROM DUAL;

    SELECT DBMS_RANDOM.VALUE(2,10) INTO var1 FROM DUAL; 
END;

Output Code:

CREATE OR REPLACE PROCEDURE PUBLIC.built_in_package_proc ()
RETURNS VARCHAR
LANGUAGE SQL
EXECUTE AS CALLER
AS
$$
   DECLARE
      var1 NUMBER (38,18);
   BEGIN
      SELECT
      /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'DBMS_RANDOM.VALUE' INSERTED. ***/
      /*** MSC-WARNING - MSCEWI3112 - DBMS_RANDOM.VALUE DIGITS OF PRECISION IS LOWER IN SNOWFLAKE ***/
      DBMS_RANDOM.VALUE()
      INTO :var1
      FROM DUAL;

         SELECT
      /*** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'DBMS_RANDOM.VALUE' INSERTED. ***/
      /*** MSC-WARNING - MSCEWI3112 - DBMS_RANDOM.VALUE DIGITS OF PRECISION IS LOWER IN SNOWFLAKE ***/
      DBMS_RANDOM.VALUE(2,10)
      INTO :var1
      FROM DUAL;
   END;
$$;

Recommendations

Last updated