SnowConvert: Oracle Functional Differences

SSC-FDM-OR0001

Note

This Feature Detection Mechanism (FDM) is deprecated and was designed for an older version of Oracle SnowConvert.

A description

This error occurs when there is a problem writing the Assessment report file. The system cannot save or generate the assessment details properly.

Best Practices

SSC-FDM-OR0002

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0068

Description

This error occurs when the START WITH value is larger than Snowflake’s maximum allowed value. According to Snowflake’s documentation, the sequence start value must be within the range of a 64-bit two’s complement integer: from -2^63 to 2^63-1. This means the maximum allowed values are:

  • Positive numbers: 9223372036854775807

  • Negative numbers: 9223372036854775808

Example Code

Input Code:
 CREATE SEQUENCE SEQUENCE1
START WITH 9223372036854775808;
Copy
 CREATE SEQUENCE SEQUENCE2
START WITH -9223372036854775809;
Copy
Generated Code:
 CREATE OR REPLACE SEQUENCE SEQUENCE1
--** SSC-FDM-OR0002 - SEQUENCE START VALUE EXCEEDS THE MAX VALUE ALLOWED BY SNOWFLAKE. **
START WITH 9223372036854775808
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}';
Copy
 CREATE OR REPLACE SEQUENCE SEQUENCE2
--** SSC-FDM-OR0002 - SEQUENCE START VALUE EXCEEDS THE MAX VALUE ALLOWED BY SNOWFLAKE. **
START WITH -9223372036854775809
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}';
Copy

Best Practices

  • We recommend resetting the sequence and adjusting how it’s used. NOTE: Make sure the target column has sufficient capacity to store this value.

  • For additional assistance, please contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0003

Note

This FDM has been deprecated. For more information, please see the documentation for SSC-EWI-OR0038.

Description

The search_clause controls how rows are processed in a SELECT statement by defining their order. While this feature allows you to customize how data is traversed and returned in Oracle, it is not available in Snowflake.

In Oracle and similar databases, the search_clause helps control how hierarchical data is processed in recursive queries or Common Table Expressions (CTEs). When you specify columns in the search_clause, you can choose whether to process the data depth-first (going deep into each branch) or breadth-first (processing level by level), which determines the order of the results.

In Snowflake, a search_clause message will be generated and then removed.

Example Code

Input Code:
 WITH dup_hiredate(eid, emp_last, mgr_id, reportLevel, hire_date, job_id) AS 
(SELECT aValue from atable) SEARCH DEPTH FIRST BY hire_date SET order1 SELECT aValue from atable;
Copy
Generated Code:
 WITH dup_hiredate(eid, emp_last, mgr_id, reportLevel, hire_date, job_id) AS
(
SELECT aValue from
atable
) /*** SSC-FDM-OR0003 - SEARCH CLAUSE REMOVED FROM THE WITH ELEMENT STATEMENT ***/
SELECT aValue from
atable;
Copy

Recommendation

SSC-FDM-OR0004

Description

In Oracle, the ORDER BY SIBLINGS clause is used in hierarchical queries to maintain the hierarchical structure while sorting sibling records (records at the same level). This feature is not available in Snowflake.

Example Code

Input Code:
 SELECT LEVEL,
       LPAD(' ', 2 * (LEVEL - 1)) || NAME AS FORMATTED_NAME,
       JOB_TITLE
FROM EMPLOYEES
START WITH MANAGER_ID IS NULL
CONNECT BY PRIOR EMPLOYEE_ID = MANAGER_ID
ORDER SIBLINGS BY NAME;
Copy
Generated Code:
 SELECT LEVEL,
       NVL(
       LPAD(' ', 2 * (
                      !!!RESOLVE EWI!!! /*** SSC-EWI-OR0036 - TYPES RESOLUTION ISSUES, ARITHMETIC OPERATION '-' MAY NOT BEHAVE CORRECTLY BETWEEN unknown AND Number ***/!!!LEVEL - 1)) :: STRING, '') || NVL(NAME :: STRING, '') AS FORMATTED_NAME,
       JOB_TITLE
FROM
       EMPLOYEES
START WITH MANAGER_ID IS NULL
CONNECT BY
       PRIOR EMPLOYEE_ID = MANAGER_ID
ORDER BY
       NAME /*** SSC-FDM-OR0004 - SIBLINGS KEYWORD REMOVED FROM ORDER BY CLAUSE BECAUSE SNOWFLAKE DOES NOT SUPPORT IT ***/;
Copy
  • Although the exact ordering provided by the SIBLINGS clause is not directly available, you can achieve similar results using these methods:

    • Wrap your query inside another query and use ORDER BY to sort the results.

    • First, create a Common Table Expression (CTE) containing your hierarchical query with CONNECT BY. Then, create another query that references this CTE and uses ORDER BY to sort siblings (rows at the same hierarchical level).

  • For additional assistance, please contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0005

Description

Snowflake does not support synonyms. Any synonyms will be converted to their original object names.

Example Code

Input Code:
 CREATE TABLE TABLE1
(
    COLUMN1 NUMBER
);

CREATE OR REPLACE SYNONYM B.TABLE1_SYNONYM FOR TABLE1;
SELECT * FROM B.TABLE1_SYNONYM WHERE B.TABLE1_SYNONYM.COLUMN1 = 20;
Copy
Generated Code:
 CREATE OR REPLACE TABLE TABLE1
    (
        COLUMN1 NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/
    )
    COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
    ;

--    --** SSC-FDM-OR0005 - SYNONYMS NOT SUPPORTED IN SNOWFLAKE BUT REFERENCES TO THIS SYNONYM WERE CHANGED BY THE ORIGINAL OBJECT NAME. **

--    CREATE OR REPLACE SYNONYM B.TABLE1_SYNONYM FOR TABLE1
                                                         ;
SELECT * FROM
    TABLE1
    WHERE
    TABLE1.COLUMN1 = 20;
Copy

Best Practices

SSC-FDM-OR0006

Description

This warning appears when a NOT NULL column constraint includes one of Oracle’s constraint states in the column’s inline definition.


 [ RELY | NORELY | RELY DISABLE | RELY ENABLE | VALIDATE | NOVALIDATE ]
Copy

Since Snowflake doesn’t support these states, the NOT NULL inline constraint will be removed.

Example Code

Input Code:
 CREATE TABLE Table1(
  col1 INT NOT NULL RELY
);
Copy
Generated Code:
 CREATE OR REPLACE TABLE Table1 (
    col1 INT NOT NULL /*** SSC-FDM-OR0006 - CONSTRAINT STATE RELY REMOVED FROM NOT NULL INLINE CONSTRAINT ***/
  )
  COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
  ;
Copy

Best Practices

SSC-FDM-OR0007

Description

Snowflake does not support object versioning. As a result, the EDITIONABLE or NONEDITIONABLE modifiers are removed during code conversion, and a warning message is generated.

Example Code

Input Code:
 CREATE OR REPLACE EDITIONABLE PROCEDURE FUN1 (n number)is
l_result number;
begin
    DELETE FROM employees;
end;
Copy
Generated Code:
 --** SSC-FDM-OR0007 - SNOWFLAKE DOESN'T SUPPORT VERSIONING OF OBJECTS. DEVELOPERS SHOULD CONSIDER ALTERNATE APPROACHES FOR CODE VERSIONING. **
CREATE OR REPLACE PROCEDURE FUN1 (n NUMBER(38, 18))
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        l_result NUMBER(38, 18);
    BEGIN
        DELETE FROM
            employees;
    END;
$$;
Copy

Best Practices

SSC-FDM-OR0008

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0071.

Description

The ‘all’ quantifier is not supported in Snowflake SQL. When converting your code, this modifier will be removed and you will receive a warning message. Please note that this modification might cause your query to produce different results than expected.

Example Code

Input Code:
 SELECT location_id  FROM locations 
MINUS ALL 
SELECT location_id  FROM departments;
Copy
Generated Code:
 SELECT location_id  FROM
locations
--** SSC-FDM-OR0008 - QUANTIFIER 'ALL' NOT SUPPORTED FOR THIS SET OPERATOR, RESULTS MAY DIFFER **
MINUS
SELECT location_id  FROM
departments;
Copy

In Snowflake, the INTERSECT and MINUS/EXCEPT operators automatically remove duplicate values from the result set.

Best Practices

  • Explore Snowflake’s equivalent options to replace the “all” quantifier functionality.

  • For additional assistance, contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0009

Description

Note

To generate Procedures and Macros in JavaScript, add either -t JavaScript or --PLTargetLanguage JavaScript to your command.

Note

For clarity, we have simplified some sections of the output code.

This warning appears when SQL implicit cursor values are used. Oracle handles these values differently based on the query type:

  • For SELECT statements: The value represents the number of rows returned

  • For UPDATE, CREATE, DELETE, or INSERT statements: The value represents the number of rows affected

This difference in behavior is why the warning is displayed.

Example Code

Input Code:
-- Additional Params: -t JavaScript
--Transformation for implicit cursor
CREATE OR REPLACE PROCEDURE SP_SAMPLE AUTHID DEFINER IS
  stmt_no  POSITIVE;
BEGIN
  IF SQL%ROWCOUNT = 0 THEN
   EXIT ;
  END IF;
  IF SQL%ISOPEN THEN
   EXIT ;
  END IF;
  IF SQL%FOUND THEN
   EXIT ;
  END IF;
  IF SQL%NOTFOUND THEN
   EXIT ;
  END IF;
END;
Copy
Generated Code:
 -- Additional Params: -t JavaScript
--Transformation for implicit cursor
CREATE OR REPLACE PROCEDURE SP_SAMPLE ()
RETURNS STRING
LANGUAGE JAVASCRIPT
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "oracle",  "convertedOn": "12/16/2024",  "domain": "test" }}'
EXECUTE AS CALLER
AS
$$
  !!!RESOLVE EWI!!! /*** SSC-EWI-0073 - PENDING FUNCTIONAL EQUIVALENCE REVIEW FOR 'PlInvokerRightsClause' NODE ***/!!!
  //AUTHID DEFINER
  null
  // SnowConvert Helpers Code section is omitted.

  let STMT_NO = new POSITIVE();
  if (SQL.ROWCOUNT /*** SSC-FDM-OR0009 - SQL IMPLICIT CURSOR VALUES MAY DIFFER ***/ == 0) {
    break;
  }
  if (SQL.ISOPEN) {
    break;
  }
  if (SQL.FOUND) {
    break;
  }
  if (SQL.NOTFOUND) {
    break;
  }
$$;
Copy

Best Practices

SSC-FDM-OR0010

Description

The NUMBER data type is used to store both fixed and floating-point numbers. It works consistently across all operating systems that run Oracle Database. Oracle recommends using the NUMBER data type as the primary choice for storing numeric values. The format is NUMBER (X, Y), where X represents the precision (total number of digits) and Y represents the scale (number of decimal places).

For example, NUMBER(5, 3) represents a number format with 2 digits before the decimal point and 3 digits after the decimal point.

12.345
Copy

Other Important Considerations:

  1. Scale Y determines how many decimal places will appear after the decimal point.

  2. Scale-Precision Y-X sets the minimum number of trailing zeros after the decimal point.

This message appears when a NUMBER data type has a precision value that is less than its scale value. Since Snowflake does not support this configuration, the precision value is automatically increased to maintain data consistency.

Note

Please note that this issue may occur in combination with other known transformations, or it may not occur at all. For example, when the scale is replaced with nineteen and the previous precision is greater than nineteen, this message will NOT appear.

Example Code

Input Code:
 CREATE TABLE SampleNumberTable(Col1 NUMBER(4, 5));

INSERT INTO SampleNumberTable (Col1)
VALUES (0.00009);

INSERT INTO SampleNumberTable (Col1)
VALUES (0.000021);

INSERT INTO SampleNumberTable (Col1)
VALUES (0.012678912);

SELECT * FROM SampleNumberTable;
Copy
Col1   |
-------+
0.00009|
0.00002|
0.01268|

Copy
Generated Code:
 CREATE OR REPLACE TABLE SampleNumberTable (Col1 NUMBER(5, 5) /*** SSC-FDM-OR0010 - NUMBER DATATYPE SMALLER PRECISION WAS INCREASED TO MATCH SCALE ***/ /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
;

INSERT INTO SampleNumberTable(Col1)
VALUES (0.00009);

INSERT INTO SampleNumberTable(Col1)
VALUES (0.000021);

INSERT INTO SampleNumberTable(Col1)
VALUES (0.012678912);

SELECT * FROM
SampleNumberTable;
Copy
Col1   |
-------+
0.00009|
0.00002|
0.01268|

Copy

Best Practices

SSC-FDM-OR0011

Description

This warning appears when the migration process removes the third optional argument from RAISE_APLICATION_ERROR, as this feature is not available in Snowflake.

Example Code

Input Code:
 CREATE OR REPLACE FUNCTION TEST(SAMPLE_A      IN NUMBER DEFAULT NULL,
                               SAMPLE_B       IN NUMBER DEFAULT NULL)
  RETURN NUMBER
 AS
BEGIN
    raise_application_error(-20001, 'First exception message', FALSE);
  RETURN 1;
END TEST;
Copy
Generated Code:
 --** SSC-FDM-0029 - USER DEFINED FUNCTION WAS TRANSFORMED TO SNOWFLAKE PROCEDURE **
CREATE OR REPLACE PROCEDURE TEST(SAMPLE_A NUMBER(38, 18) DEFAULT NULL,
                              SAMPLE_B NUMBER(38, 18) DEFAULT NULL)
RETURNS NUMBER(38, 18)
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
 DECLARE
  FIRST_EXCEPTION_MESSAGE_EXCEPTION_CODE_0 EXCEPTION (-20001, 'FIRST EXCEPTION MESSAGE');
 BEGIN
  --** SSC-FDM-OR0011 - ADD TO STACK OF ERRORS IS NOT SUPPORTED, BOOLEAN ARGUMENT FALSE WAS REMOVED. **
  RAISE FIRST_EXCEPTION_MESSAGE_EXCEPTION_CODE_0;
  RETURN 1;
 END;
$$;
Copy

Best Practices

SSC-FDM-OR0012

Description

Before using COMMIT and ROLLBACK statements in Snowflake, you must first execute specific setup instructions to ensure they work correctly. These statements require proper configuration to function as expected.

 ALTER SESSION SET AUTOCOMMIT = false;
Copy

Example Code

Input Code
 COMMIT;
ROLLBACK;
Copy
Output Code
 --** SSC-FDM-OR0012 - COMMIT REQUIRES THE APPROPRIATE SETUP TO WORK AS INTENDED **
COMMIT;

--** SSC-FDM-OR0012 - ROLLBACK REQUIRES THE APPROPRIATE SETUP TO WORK AS INTENDED **
ROLLBACK;
Copy

Best Practices

SSC-FDM-OR0013

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0039.

Description

This message appears when SnowConvert detects a query containing a CYCLE clause. Since Snowflake does not support CYCLE clauses, SnowConvert automatically comments out this code during conversion.

This statement indicates when a recursive operation occurs.

For additional information about the clause functionality, please refer to the documentation.

Example Code

Connect By

Input Code:
 CREATE OR REPLACE FORCE NONEDITIONABLE VIEW VIEW01 AS
SELECT
      UNIQUE A.*
FROM
      TABLITA A
WHERE
      A.X = A.C CONNECT BY NOCYCLE A.C = 0 START WITH A.B = 1
HAVING
      X = 1
GROUP BY
      A.C;
Copy
Generated Code:
 CREATE OR REPLACE VIEW VIEW01
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
AS
SELECT DISTINCT
      A.*
FROM
      TABLITA A
WHERE
      A.X = A.C
GROUP BY
      A.C
HAVING
      X = 1
--** SSC-FDM-OR0013 - CYCLE CLAUSE IS NOT SUPPORTED IN SNOWFLAKE **
CONNECT BY
      A.C = 0 START WITH A.B = 1;
Copy

Best Practices

SSC-FDM-OR0014

Description

This error occurs when the data type of a foreign key does not match the data type of the referenced column.

Example Code

Input Code:
 CREATE TABLE "MyDb"."MyTable"
(
    "COL1" NUMBER,
    CONSTRAINT "PK" PRIMARY KEY ("COL1")
);

CREATE TABLE "MyDb"."MyTable1"
(   
    "COL1" NUMBER(*,0),
    CONSTRAINT "FK1" FOREIGN KEY ("COL1") REFERENCES "MyDb"."MyTable" ("COL1")
);
Copy
Generated Code:
 CREATE OR REPLACE TABLE "MyDb"."MyTable"
    (
        "COL1" NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/,
        CONSTRAINT "PK" PRIMARY KEY ("COL1")
    )
    COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
    ;

    CREATE OR REPLACE TABLE "MyDb"."MyTable1"
    (
        "COL1" NUMBER(38) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/
    )
    COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
    ;

    ALTER TABLE "MyDb"."MyTable1"
    ADD
    --** SSC-FDM-OR0014 - FOREIGN KEY DATA TYPE MISMATCH **
    CONSTRAINT "FK1" FOREIGN KEY ("COL1") REFERENCES "MyDb"."MyTable" ("COL1");
Copy

Note

The error occurs because the columns “COL1” in “MyDb”.”MyTable1” and “MyDb”.”MyTable” have different data types.

Best Practices

SSC-FDM-OR0015

Description

This issue occurs when using the LENGTHB function, which calculates the size of a column or literal value in bytes. During migration, this function is automatically converted to Snowflake’s OCTET_LENGTH function.

When using this function with a column parameter, it calculates the size of the column’s value. The resulting size may differ between Oracle and Snowflake because it depends on the column’s data type.

Example Code

Input Code:
 CREATE TABLE char_table
(
	char_column1 CHAR(15)
);

INSERT INTO char_table VALUES ('Hello world');

SELECT char_column1, LENGTHB(char_column1), LENGTH('Hello world') FROM char_table;
Copy
|CHAR_COLUMN1   |LENGTHB(CHAR_COLUMN1)|LENGTH('HELLOWORLD')|
|---------------|---------------------|--------------------|
|Hello world    |15                   |11                  |


Copy
Generated Code:
CREATE OR REPLACE TABLE char_table
(
	char_column1 CHAR(15)
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
;

INSERT INTO char_table
VALUES ('Hello world');

SELECT char_column1,
OCTET_LENGTH(char_column1) /*** SSC-FDM-OR0015 - LENGTHB TRANSFORMED TO OCTET_LENGTH RESULTS MAY VARY DUE TO MEMORY MANAGEMENT OF DBMS ***/, LENGTH('Hello world') FROM
char_table;
Copy
|CHAR_COLUMN1|OCTET_LENGTH(CHAR_COLUMN1)|LENGTH('HELLO WORLD')|
|------------|--------------------------|---------------------|
|Hello world |11                        |11                   |


Copy

Best Practices

  • Review the data types used in your code.

  • Verify column encoding since OCTET_LENGTH may show larger sizes for strings containing Unicode characters.

  • For additional assistance, contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0016

Description

COMMIT and ROLLBACK statements are no longer needed since Snowflake handles these operations automatically.

Example Code

Input Code
 COMMIT WORK FORCE '22.57.53';
ROLLBACK WORK FORCE '22.57.53';
Copy
Output Code
 --** SSC-FDM-OR0016 - COMMIT OPTIONS REMOVED BECAUSE SNOWFLAKE DOES NOT REQUIRE THEM **
--** SSC-FDM-OR0012 - COMMIT REQUIRES THE APPROPRIATE SETUP TO WORK AS INTENDED **
COMMIT WORK;

--** SSC-FDM-OR0016 - ROLLBACK OPTIONS REMOVED BECAUSE SNOWFLAKE DOES NOT REQUIRE THEM **
--** SSC-FDM-OR0012 - ROLLBACK REQUIRES THE APPROPRIATE SETUP TO WORK AS INTENDED **
ROLLBACK WORK;
Copy

Best Practices

SSC-FDM-OR0017

Description

The AT TIME ZONE expression no longer supports the DBTIMEZONE keyword.

Example Code

Input Code:
 SELECT TIMESTAMP '1998-12-25 09:26:50.12' AT TIME ZONE DBTIMEZONE FROM DUAL;
Copy
Generated Code:
 SELECT
--** SSC-FDM-OR0017 - DBTIMEZONE WAS REMOVED TO USE THE DEFAULT VALUE OF THE TIMESTAMP **
TO_TIMESTAMP_LTZ( TIMESTAMP '1998-12-25 09:26:50.12')
FROM DUAL;
Copy

Best Practices

SSC-FDM-OR0018

Description

This warning indicates that there may be functional differences between Oracle’s merge statement and Snowflake’s merge statement implementation.

Example Code

Input Code:
 MERGE INTO people_target pt 
USING people_source ps 
ON    (pt.person_id = ps.person_id) 
WHEN MATCHED THEN UPDATE 
  SET pt.first_name = ps.first_name, 
      pt.last_name = ps.last_name, 
      pt.title = ps.title 
  DELETE where pt.title  = 'Mrs.' 
WHEN NOT MATCHED THEN INSERT 
  (pt.person_id, pt.first_name, pt.last_name, pt.title) 
  VALUES (ps.person_id, ps.first_name, ps.last_name, ps.title) 
  WHERE ps.title = 'Mr';
Copy
Generated Code:
 --** SSC-FDM-OR0018 - SNOWFLAKE MERGE STATEMENT MAY HAVE SOME FUNCTIONAL DIFFERENCES COMPARED TO ORACLE **
--** SSC-FDM-0007 - MISSING DEPENDENT OBJECTS "people_target", "people_source" **
MERGE INTO people_target pt
USING people_source ps
ON    (pt.person_id = ps.person_id)
      WHEN MATCHED AND pt.title  = 'Mrs.' THEN
        DELETE
      WHEN MATCHED THEN
        UPDATE SET
          pt.first_name = ps.first_name,
               pt.last_name = ps.last_name,
               pt.title = ps.title
      WHEN NOT MATCHED AND ps.title = 'Mr' THEN
        INSERT
        (pt.person_id, pt.first_name, pt.last_name, pt.title)
        VALUES (ps.person_id, ps.first_name, ps.last_name, ps.title);
Copy

Best Practices

  • If your results differ from Oracle, please consider these steps:

    • Review execution order priorities in the link

    • Run any skipped DML statements either before or after the merge statement, as appropriate

  • For additional assistance, contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0019

Description

This warning appears when a ROWS window frame unit is detected in your source code.

The ROWS function relies on the physical order of rows in the database, which can vary when migrating to a different platform. To prevent inconsistencies, you can add explicit ORDER BY clauses to ensure consistent row ordering.

Note

According to the Oracle documentation, analytic functions behave differently based on their offset type:

  • Logical offset functions always return deterministic results

  • Physical offset functions may return non-deterministic results unless you ensure unique ordering

  • To achieve unique ordering, you may need to include multiple columns in the order_by_clause

It is recommended to verify that the function produces consistent (deterministic) results before proceeding, to prevent potential problems.

Example Code

Input Code:
 SELECT
SUM(C_BIRTH_DAY)
OVER (
    ORDER BY C_BIRTH_COUNTRY
    ROWS UNBOUNDED PRECEDING) AS MAX1
FROM WINDOW_TABLE;
Copy
Generated Code:
 SELECT
SUM(C_BIRTH_DAY)
OVER (
    ORDER BY C_BIRTH_COUNTRY ROWS UNBOUNDED PRECEDING /*** SSC-FDM-OR0019 - WINDOW FRAME OUTPUT MAY NOT BE EQUIVALENT ***/) AS MAX1
FROM
WINDOW_TABLE;
Copy

Best Practices

  • Add an ORDER BY clause to your queries to ensure consistent row ordering in Snowflake results.

  • For additional assistance, contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0020

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0051.

Description

This warning appears when using the PRAGMA EXCEPTION_INIT function inside a procedure. The exception name and SQL error code are defined in the RAISE function. During conversion to Snowflake Scripting, the SQL error code is included in the exception declaration. However, some error codes may not be valid in Snowflake Scripting.

Example Code

Input Code:
 CREATE OR REPLACE PROCEDURE EXCEPTION_DECLARATION_SAMPLE AUTHID DEFINER IS
  NEW_EXCEPTION EXCEPTION;
  PRAGMA EXCEPTION_INIT(NEW_EXCEPTION, -63);
  NEW_EXCEPTION2 EXCEPTION;
  PRAGMA EXCEPTION_INIT ( NEW_EXCEPTION2, -20100 );
BEGIN

  IF true THEN
    RAISE NEW_EXCEPTION;
  END IF;

EXCEPTION
    WHEN NEW_EXCEPTION THEN
        --Handle Exceptions
        NULL;
END;
/
Copy
Generated Code:
Snowflake Scription
 CREATE OR REPLACE PROCEDURE EXCEPTION_DECLARATION_SAMPLE ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0097 - PROCEDURE PROPERTIES ARE NOT SUPPORTED IN SNOWFLAKE PROCEDURES ***/!!!
AS
$$
  DECLARE
    --** SSC-FDM-OR0023 - EXCEPTION CODE NUMBER EXCEEDS SNOWFLAKE SCRIPTING LIMITS **
    NEW_EXCEPTION EXCEPTION;
    --** SSC-FDM-OR0020 - PRAGMA EXCEPTION_INIT IS NOT SUPPORTED **
    PRAGMA EXCEPTION_INIT(NEW_EXCEPTION, -63);
    NEW_EXCEPTION2 EXCEPTION (-20100, '');
    --** SSC-FDM-OR0020 - PRAGMA EXCEPTION_INIT IS NOT SUPPORTED **
  PRAGMA EXCEPTION_INIT ( NEW_EXCEPTION2, -20100 );
  BEGIN
    IF (true) THEN
      RAISE NEW_EXCEPTION;
    END IF;
    EXCEPTION
        WHEN NEW_EXCEPTION THEN
            --Handle Exceptions
            NULL;
    END;
$$;
Copy

Best Practices

SSC-FDM-OR0021

Description

The FOR LOOP condition in Snowflake Scripting requires an INTEGER value or an expression that results in an INTEGER. If you use floating-point numbers, they will be automatically rounded, which may change your intended loop boundary.

The lower bound will be rounded down to the nearest whole number. For example:

3.1 -> 3, 6.7 -> 7, 4.5 -> 5

The upper bound will be rounded down to the nearest whole number. For example:

3.1 -> 3, 6.7 -> 6, 4.5 -> 4

 CREATE OR REPLACE PROCEDURE p1()
RETURNS VARCHAR
LANGUAGE SQL
AS
$$
    DECLARE
        var1 VARCHAR DEFAULT '';
        var2 VARCHAR DEFAULT '';
        var3 VARCHAR DEFAULT '';
    BEGIN
        --Loop 1
        FOR i IN 1.2 TO 5.2 DO
            var1 := var1 || ' ' || i::VARCHAR;
        END FOR;
        
        --Loop 2
        FOR i IN 1.7 TO 5.5 DO
            var2 := var2 || ' ' || i::VARCHAR;
        END FOR;
        
        --Loop 3
        FOR i IN 1.5 TO 5.8 DO
            var3 := var3 || ' ' || i::VARCHAR;
        END FOR;
        RETURN  ' Loop1: ' || var1 ||
                ' Loop2: ' || var2 ||
                ' Loop3: ' || var3;
    END;
$$;

CALL p1();
Copy
P1                                                |
--------------------------------------------------+
 Loop1:  1 2 3 4 5                                |
 Loop2:  2 3 4 5                                  |
 Loop3:  2 3 4 5                                  |

Copy

Example Code

Input Code:
 CREATE OR REPLACE PROCEDURE p1
AS
BEGIN
FOR i NUMBER(5,1) IN 1.2 .. 5.7 LOOP
    NULL;
END LOOP;
END;
Copy
Generated Code:
 CREATE OR REPLACE PROCEDURE p1 ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    BEGIN
        --** SSC-FDM-OR0021 - FOR LOOP WITH FLOAT NUMBER AS LOWER OR UPPER BOUND MAY NOT BEHAVE CORRECTLY IN SNOWFLAKE SCRIPTING **
        FOR i IN 1.2 TO 5.7 LOOP
            NULL;
        END LOOP;
    END;
$$;
Copy

Best Practices

SSC-FDM-OR0022

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0100.

Description

Snowflake Scripting’s FOR LOOP supports only one condition, unlike Oracle which allows multiple conditions. When migrating from Oracle, only the first condition will be transformed, and any additional conditions will be ignored.

Example Code

Input Code:
 CREATE OR REPLACE PROCEDURE P3
AS
BEGIN
FOR i IN REVERSE 1..3,
REVERSE i+5..i+7
LOOP
    NULL;
END LOOP; 
END;
Copy
Generated Code:
 CREATE OR REPLACE PROCEDURE P3 ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    BEGIN
        --** SSC-FDM-OR0022 - FOR LOOP WITH MULTIPLE CONDITIONS IS CURRENTLY NOT SUPPORTED BY SNOWFLAKE SCRIPTING **
        FOR i IN REVERSE 1 TO 3 LOOP
            NULL;
        END LOOP;
    END;
$$;
Copy

Best Practices

  • Break down complex FOR LOOP statements into multiple, simpler loops or rewrite the loop condition for better clarity.

  • For additional assistance, please contact our support team at snowconvert-support@snowflake.com

SSC-FDM-OR0023

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0099.

Description

This warning appears when an exception code number is outside the allowed range for Snowflake Scripting exceptions. Valid exception codes must be integers between -20000 and -20999.

Example Code

Input Code:
 CREATE OR REPLACE PROCEDURE procedure_exception
IS
my_exception EXCEPTION;
PRAGMA EXCEPTION_INIT ( my_exception, -19000 );
BEGIN
    NULL; 
END;
Copy
Generated Code:
CREATE OR REPLACE PROCEDURE procedure_exception ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        --** SSC-FDM-OR0023 - EXCEPTION CODE NUMBER EXCEEDS SNOWFLAKE SCRIPTING LIMITS **
        my_exception EXCEPTION;
        --** SSC-FDM-OR0020 - PRAGMA EXCEPTION_INIT IS NOT SUPPORTED **
        PRAGMA EXCEPTION_INIT ( my_exception, -19000 );
    BEGIN
        NULL;
    END;
$$;
Copy

Best Practices

  • Verify that your exception code falls within Snowflake Scripting’s allowed range. If not, select a different available exception number.

  • For additional assistance, contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0024

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0002.

Description

This error occurs when the system cannot resolve the columns in a Select Expression. This typically happens in two scenarios:

  1. When referencing a Type Access that hasn’t been resolved

  2. When using a column with a User Defined Type that lacks column definitions (for example, a Type Without Body or an Object Type with no defined columns)

Example Code

Input Code:
 CREATE OR REPLACE PROCEDURE record_unknown_table_proc
AS
    unknownTable_variable_rowtype unknownTable%ROWTYPE;
BEGIN
    INSERT INTO MyTable values unknownTable_variable_rowtype;
END;
Copy
Generated Code:
 CREATE OR REPLACE PROCEDURE record_unknown_table_proc ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        unknownTable_variable_rowtype OBJECT !!!RESOLVE EWI!!! /*** SSC-EWI-0036 - ROWTYPE DATA TYPE CONVERTED TO OBJECT ***/!!! := OBJECT_CONSTRUCT();
    BEGIN
        INSERT INTO MyTable
        SELECT
            null /*** SSC-FDM-OR0024 - COLUMNS FROM EXPRESSION unknownTable%ROWTYPE NOT FOUND ***/;
    END;
$$;
Copy

Best Practices

SSC-FDM-OR0025

Description

The NOT NULL constraint, which is used in Oracle variable declarations within procedures, is not available in Snowflake procedure variable declarations.

Example Code

Input Code:
 CREATE OR REPLACE PROCEDURE PROC04
IS
 var3 FLOAT NOT NULL := 100;
BEGIN
NULL;
END;
Copy
Generated Code:
 CREATE OR REPLACE PROCEDURE PROC04 ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
 DECLARE
  var3 FLOAT := 100 /*** SSC-FDM-OR0025 - NOT NULL CONSTRAINT IS NOT SUPPORTED BY SNOWFLAKE ***/;
 BEGIN
  NULL;
 END;
$$;
Copy

Recommendations

SSC-FDM-OR0026

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0045.

Description

This error occurs when you attempt to convert data to an unsupported data type.

Example

Input Code:
 select cast(' $123.45' as number, 'L999.99') from dual;
Copy
Generated Code:
 select
--** SSC-FDM-OR0026 - CAST TYPE NOT SUPPORTED **
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0011 - THE FORMAT PARAMETER ' $123.45' IS NOT SUPPORTED ***/!!!
 cast(' $123.45' as NUMBER(38, 18) , 'L999.99') from dual;
Copy

Related EWIs

  1. SSC-EWI-OR0011: The ‘format’ parameter cannot be used in this context.

Recommendations

  • The cast operation is transformed into a user-defined function (UDF/Stub), allowing you to customize how the cast function behaves.

  • For additional assistance, please contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0027

Note

This FDM has been deprecated. For more information, please see the documentation for SSC-EWI-OR0029.

Description

Snowflake does not support the “Default on conversion error” feature.

Example Code

Input Code:
 SELECT TO_NUMBER('2,00' DEFAULT 0 ON CONVERSION ERROR) "Value" FROM DUAL;
Copy
Output Code:
 SELECT
--** SSC-FDM-OR0027 - DEFAULT ON CONVERSION ERROR NOT SUPPORTED IN SNOWFLAKE IN SNOWFLAKE **
TO_NUMBER('2,00') "Value" FROM DUAL;
Copy

Recommendations

  • Consider creating a User-Defined Function (UDF) to replicate the functionality of the DEFAULT value when handling ON CONVERSION ERROR.

  • For additional assistance, please contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0028

Note

This FDM has been deprecated. For current documentation, please refer to SSC-EWI-OR0031.

Description

This error occurs when you attempt to use an unsupported parameter in the SYS_CONTEXT function.

Example Code

Input Code:
 SELECT SYS_CONTEXT ('USERENV', 'NLS_SORT') FROM DUAL;
Copy
Output Code:
 SELECT
--** SSC-FDM-OR0028 - 'NLS_SORT' SYS_CONTEXT PARAMETER NOT SUPPORTED IN SNOWFLAKE **
SYS_CONTEXT ('USERENV', 'NLS_SORT') FROM DUAL;
Copy

Recommendations

  • The function is converted to a user-defined function (UDF) stub, which you can modify to replicate the behavior of the SYS_CONTEXT parameter.

  • For additional assistance, please contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0029

Description

The ALTER SESSION statement contains a clause or configuration that is not supported in the current version.

Example Code

Input Code:
 ALTER SESSION SET SQL_TRACE TRUE;
Copy
Output Code:
 ----** SSC-FDM-OR0029 - THIS ALTER SESSION CONFIGURATION IS NOT SUPPORTED IN SNOWFLAKE **
--ALTER SESSION SET SQL_TRACE TRUE
                                ;
Copy

Recommendations

SSC-FDM-OR0030

Description

When a query includes ROWID as a pseudocolumn, it is converted to NULL to prevent runtime errors, and an Error, Warning, and Information (EWI) message is generated. Currently, there is no feature available to replicate the ROWID functionality.

Example Code

Input Code Oracle:
 SELECT ROWID FROM T1;
Copy
Output Code:
 SELECT
--** SSC-FDM-OR0030 - ROWID PSEUDOCOLUMN IS NOT SUPPORTED IN SNOWFLAKE, IT WAS CONVERTED TO NULL TO AVOID RUNTIME ERRORS **
'' AS ROWID
FROM
T1;
Copy

Recommendations

SSC-FDM-OR0031

Description

This error indicates that Snowflake’s DML statements do not support the error_logging clause, which is a feature available in Oracle’s DML statements.

Example Code

Input Code:
 MERGE INTO people_target pt 
USING people_source ps ON (pt.person_id = ps.person_id) 
WHEN MATCHED THEN UPDATE 
  SET pt.first_name = ps.first_name, 
      pt.last_name = ps.last_name, 
      pt.title = ps.title
LOG ERRORS;
Copy
Output Code:
 MERGE INTO people_target pt
USING people_source ps ON (pt.person_id = ps.person_id)
  WHEN MATCHED THEN
    UPDATE
    SET pt.first_name = ps.first_name,
        pt.last_name = ps.last_name,
        pt.title = ps.title
--  --** SSC-FDM-OR0031 - THE ERROR LOGGING CLAUSE IN DML STATEMENTS IS NOT SUPPORTED BY SNOWFLAKE **
--LOG ERRORS
          ;
Copy

Recommendations

SSC-FDM-OR0032

Description

This warning appears when using Oracle’s STANDARD_HASH function with non-string parameters, as it may produce different results when migrated to Snowflake.

Example Code

Input Code:
 SELECT STANDARD_HASH(1+1) FROM DUAL;
Copy
 STANDARD_HASH(1+1)                               |
--------------------------------------------------+
 E39323970701D93598FC1D357F4BF04578CE3242         |

Copy
Output Code:
SELECT
--** SSC-FDM-OR0032 - STANDARD HASH FUNCTION WITH INPUT NON-STRING PARAMETER GENERATES A DIFFERENT RESULT IN SNOWFLAKE **
SHA1(1+1)
FROM DUAL;
Copy
 SHA1(1+1)                                        |
--------------------------------------------------+
 da4b9237bacccdf19c0760cab7aec4a8359010b0         |
Copy

Recommendations

SSC-FDM-OR0033

Description

This warning appears when SnowConvert migrates an Oracle DBMS_RANDOM.VALUE built-in package function. The User-Defined Function (UDF) created to replicate this functionality has lower precision compared to the original Oracle 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;
Copy
Output Code:
 CREATE OR REPLACE PROCEDURE built_in_package_proc ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        var1 NUMBER(38, 18);
    BEGIN
        SELECT
            --** SSC-FDM-OR0033 - DBMS_RANDOM.VALUE DIGITS OF PRECISION ARE LOWER IN SNOWFLAKE **
            DBMS_RANDOM.VALUE_UDF() INTO
            :var1
        FROM DUAL;

        SELECT
            --** SSC-FDM-OR0033 - DBMS_RANDOM.VALUE DIGITS OF PRECISION ARE LOWER IN SNOWFLAKE **
            DBMS_RANDOM.VALUE_UDF(2,10) INTO
            :var1
        FROM DUAL;
    END;
$$;
Copy

Recommendations

SSC-FDM-OR0034

Note

This FDM is no longer supported. For more information, please see the SSC-EWI-OR0001 documentation.

Description

This error occurs when the value in the START WITH statement is set to LIMIT VALUE.

In Oracle, this clause is only used with the ALTER TABLE statement.

  • The START WITH LIMIT VALUE option, which is only available for identity_options, can only be used with ALTER TABLE MODIFY. When you use START WITH LIMIT VALUE, Oracle Database will:

  1. Lock the table

  2. Find the maximum value (for increasing sequences) or minimum value (for decreasing sequences) in the identity column

  3. Set this value as the sequence generator’s high water mark

  4. Generate the next value by adding the INCREMENT BY value to the high water mark (for increasing sequences) or subtracting it (for decreasing sequences)

ALTER TABLE ORACLE

Example Code

Input Code:
 CREATE SEQUENCE SEQUENCE1
  START WITH LIMIT VALUE;
Copy
Output Code:
 CREATE OR REPLACE SEQUENCE SEQUENCE1
  --** SSC-FDM-OR0034 - SEQUENCE START VALUE WITH 'LIMIT VALUE' IS NOT SUPPORTED BY SNOWFLAKE. **
  START WITH LIMIT VALUE
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}';
Copy

Recommendations

SSC-FDM-OR0035

Description

This warning appears when SnowConvert migrates an Oracle DBMS_OUTPUT.PUT_LINE built-in package function. You should review the generated User-Defined Function (UDF) to ensure it works as expected.

This warning message indicates that you need to review the implementation of DBMS_OUTPUT.PUT_LINE_UDF for additional information.

Warning

This UDF may impact performance. To enable logging, uncomment the implementation code. Please note that the current setup uses a temporary table. If you need the data to persist across sessions, remove the TEMPORARY keyword from the CREATE TABLE statement.

After executing the DBMS_OUTPUT.PUT_LINE_UDF function, you can view all the logs by running this query:

SELECT * FROM DBMS_OUTPUT.DBMS_OUTPUT_LOG

Example code

Input Code:
 CREATE OR REPLACE PROCEDURE builtin_package_call
IS
BEGIN
	DBMS_OUTPUT.PUT_LINE(1);
	DBMS_OUTPUT.PUT_LINE("Test");
END;
Copy
Output Code:
 CREATE OR REPLACE PROCEDURE builtin_package_call ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
	BEGIN
		--** SSC-FDM-OR0035 - CHECK UDF IMPLEMENTATION FOR DBMS_OUTPUT.PUT_LINE_UDF. **
		CALL DBMS_OUTPUT.PUT_LINE_UDF(1);
		--** SSC-FDM-OR0035 - CHECK UDF IMPLEMENTATION FOR DBMS_OUTPUT.PUT_LINE_UDF. **
		CALL DBMS_OUTPUT.PUT_LINE_UDF("Test");
	END;
$$;
Copy

Recommendations

SSC-FDM-OR0036

Description

This message appears when SnowConvert removes certain arguments while migrating an Oracle built-in package procedure or function.

Original parameters that do not have matching equivalents in Snowflake, or are no longer necessary, will be removed from the converted code. However, these parameters are documented in the EWI (Error, Warning, Information) messages for reference and tracking purposes.

Example Code

Input Code:
 CREATE OR REPLACE PROCEDURE built_in_package_proc
IS
w_file UTL_FILE.FILE_TYPE;
BEGIN
    w_file:= UTL_FILE.FOPEN('MY_DIR','test.txt','W',32760);
    UTL_FILE.PUT_LINE(w_file,'New line');    
END;
Copy
Output Code:
 CREATE OR REPLACE PROCEDURE built_in_package_proc ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        w_file OBJECT /*** SSC-FDM-0015 - REFERENCED CUSTOM TYPE 'UTL_FILE.FILE_TYPE' IN QUERY NOT FOUND, USAGES MAY BE AFFECTED ***/ := OBJECT_CONSTRUCT();
    BEGIN
        --** SSC-FDM-OR0036 - PARAMETERS: 'LOCATION, MAX_LINESIZE_UDF' UNNECESSARY IN THE IMPLEMENTATION. **
        CALL UTL_FILE.FOPEN_UDF('test.txt', 'W');
        SELECT
            *
        INTO
            w_file
        FROM
            TABLE(RESULT_SCAN(LAST_QUERY_ID()));
        --** SSC-FDM-OR0036 - PARAMETERS: 'AUTOFLUSH_UDF' UNNECESSARY IN THE IMPLEMENTATION. **
        CALL UTL_FILE.PUT_LINE_UDF(:w_file, 'New line');
    END;
$$;
Copy

Recommendations

SSC-FDM-OR0037

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0004.

Note

For better readability, we have simplified some sections of the code in this example.

Description

This warning appears when a SELECT statement contains a clause that Snowflake does not support. The following clauses are not supported:

  • Container databases and pluggable databases

  • Limitations on subquery usage

  • Hierarchical data structures and queries

  • External table modifications

  • Database links and cross-database connections

  • Database sharding configurations

  • Table partitioning

  • Table subpartitioning

  • Hierarchical query operations

Example Code

Input Code:
 SELECT * FROM TABLE1 EXTERNAL MODIFY (LOCATION 'file.csv' REJECT LIMIT UNLIMITED);
Copy
Output Code:
 --** SSC-FDM-0007 - MISSING DEPENDENT OBJECT "TABLE1" **
SELECT * FROM
TABLE1
--       --** SSC-FDM-OR0037 - THE 'OPTIONAL MODIFIED EXTERNAL' SYNTAX IN SELECT IS NOT SUPPORTED IN SNOWFLAKE **
--       EXTERNAL MODIFY (LOCATION 'file.csv' REJECT LIMIT UNLIMITED)
                                                                   ;
Copy

Recommendations

SSC-FDM-OR0038

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0128.

Description

This message indicates that a boolean cursor attribute cannot be used in SnowScript, either because it is not supported or because there is no equivalent functionality. The table below lists the boolean cursor attributes that can be replicated in SnowScript:

Boolean Cursor Attribute

Status

%FOUND

Can be emulated

%NOTFOUND

Can be emulated

%ISOPEN

Not Supported

Example Code

Input Code:
 CREATE OR REPLACE PROCEDURE cursor_attributes_proc
IS
    is_open_attr BOOLEAN;
    found_attr BOOLEAN;
    my_record table1%ROWTYPE;
    CURSOR my_cursor IS SELECT * FROM table1;
BEGIN
    OPEN my_cursor;
    LOOP
        FETCH my_cursor INTO my_record;
        EXIT WHEN my_cursor%NOTFOUND;
        is_open_attr := my_cursor%ISOPEN;
        found_attr := my_cursor%FOUND;
    END LOOP;
    CLOSE my_cursor;
END;
Copy
Output Code:
 --** SSC-FDM-0007 - MISSING DEPENDENT OBJECT "table1" **
CREATE OR REPLACE PROCEDURE cursor_attributes_proc ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        is_open_attr BOOLEAN;
        found_attr BOOLEAN;
        my_record OBJECT !!!RESOLVE EWI!!! /*** SSC-EWI-0036 - ROWTYPE DATA TYPE CONVERTED TO OBJECT ***/!!! := OBJECT_CONSTRUCT();
        my_cursor CURSOR
        FOR
            SELECT
                OBJECT_CONSTRUCT( *) sc_cursor_record FROM
                table1;
    BEGIN
        OPEN my_cursor;
        LOOP
            --** SSC-PRF-0003 - FETCH INSIDE A LOOP IS CONSIDERED A COMPLEX PATTERN, THIS COULD DEGRADE SNOWFLAKE PERFORMANCE. **
            FETCH my_cursor INTO
                :my_record;
            IF (my_record IS NULL) THEN
                EXIT;
            END IF;
            is_open_attr := null /*my_cursor%ISOPEN*/ /*** SSC-FDM-OR0038 - BOOLEAN CURSOR ATTRIBUTE %ISOPEN IS NOT SUPPORTED IN SNOWFLAKE ***/;
            found_attr := my_record IS NOT NULL;
        END LOOP;
        CLOSE my_cursor;
    END;
$$;
Copy

Recommendations

SSC-FDM-OR0039

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0007.

Description

This message appears when attempting to use a Create Type statement that Snowflake does not support.

Example Code

Input Code (Oracle):
 CREATE TYPE type6 UNDER type5(COL1 INTEGER);
Copy
Output Code:
 ----** SSC-FDM-OR0039 - CREATE TYPE SUBTYPE IS NOT SUPPORTED IN SNOWFLAKE **
--CREATE TYPE type6 UNDER type5(COL1 INTEGER)
                                           ;
Copy

Recommendations

SSC-FDM-OR0040

Description

Snowflake does not allow modification of numeric values. In Snowflake, decimals are always represented using a dot (.) as the decimal separator. The ALTER session statement has been commented out and a warning message has been added.

Example Code

Oracle:
 ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ',.';
Copy
Snowflake Scripting
 ----** SSC-FDM-OR0040 - NUMERIC CHARACTERS CANNOT BE ALTERED IN SNOWFLAKE. THE DECIMAL SEPARATOR IN SNOWFLAKE IS THE DOT CHARACTER. **
--ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ',.'
                                               ;
Copy

Recommendations

SSC-FDM-OR0041

Note

This FDM is no longer supported. For more information, please see SSC-EWI-OR0076

Description

Built-in package translation is not currently available.

Example Code

Input Code (Oracle):
 SELECT
UTL_RAW.CAST_TO_RAW('some magic here'),
DBMS_UTILITY.GET_TIME
FROM DUAL;
Copy
Output Code:
 SELECT
--** SSC-FDM-OR0041 - TRANSLATION FOR BUILT-IN PACKAGE 'UTL_RAW.CAST_TO_RAW' IS NOT CURRENTLY SUPPORTED. **
'' AS CAST_TO_RAW,
--** SSC-FDM-OR0041 - TRANSLATION FOR BUILT-IN PACKAGE 'DBMS_UTILITY.GET_TIME' IS NOT CURRENTLY SUPPORTED. **
'' AS GET_TIME
FROM DUAL;
Copy

Recommendations

SSC-FDM-OR0042

Description

The Date data type is converted to either Date or Timestamp in Snowflake. This conversion depends on the –disableDateAsTimestamp flag, as Snowflake’s Date type behaves differently from Oracle’s Date type.

Key Differences

Oracle DATE

Snowflake DATE

Functionality

Stores date and time information

Stores only date information (year, month, day)

Internal Storage

Binary number representing seconds since epoch

Compact format optimized for dates

Use Cases

General-purpose date and time storage

Scenarios where only date information is needed

Advantages

Supports both date and time

More efficient storage for dates

Limitations

Can’t store date and time components separately.

Doesn’t store time information

Example Code

Input Code (Oracle):
 CREATE TABLE "PUBLIC"."TABLE1"
(
    "CREATED_DATE" DATE,
    "UPDATED_DATE" DATE
);
Copy
Output Code:
 CREATE OR REPLACE TABLE "PUBLIC"."TABLE1"
    (
        "CREATED_DATE" TIMESTAMP /*** SSC-FDM-OR0042 - DATE TYPE COLUMN HAS A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/,
        "UPDATED_DATE" TIMESTAMP /*** SSC-FDM-OR0042 - DATE TYPE COLUMN HAS A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/
    )
    COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
    ;
Copy
 -- Additional Params: --disableDateAsTimestamp
CREATE OR REPLACE TABLE "PUBLIC"."TABLE1"
    (
        "CREATED_DATE" DATE /*** SSC-FDM-OR0042 - DATE TYPE COLUMN HAS A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/,
        "UPDATED_DATE" DATE /*** SSC-FDM-OR0042 - DATE TYPE COLUMN HAS A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/
    )
    COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
    ;
Copy

Recommendations

SSC-FDM-OR0043

Description

This error occurs when converting a TO_CLOB function to TO_VARCHAR. When working with BFILE or BLOB parameters, you may need to specify a format parameter for proper conversion.

Example Code

Input Code:
 SELECT TO_CLOB('Lorem ipsum dolor sit amet') FROM DUAL;
Copy
Output Code:
 SELECT
--** SSC-FDM-OR0043 - BFILE/BLOB PARAMETERS ARE CONSIDERED BINARY, FORMAT MAY BE NEEDED. **
TO_VARCHAR('Lorem ipsum dolor sit amet')
FROM DUAL;
Copy

Recommendations

  • Verify that the output results match between the original code and the converted code. Add a format parameter if necessary to ensure compatibility.

  • For additional assistance, contact our support team at snowconvert-support@snowflake.com

SSC-FDM-OR0044

Note

For clarity, we have simplified the code by omitting some parts.

Description

This warning appears when using Oracle’s REGEXP_LIKE function with a match parameter (third parameter). The warning indicates that the REGEXP_LIKE_UDF function in Snowflake, which replaces Oracle’s REGEXP_LIKE, may not support all match parameter characters. As a result, the query output in Snowflake might differ from Oracle.

Example Code

Input Code Oracle:
 SELECT last_name
FROM hr.employees
WHERE REGEXP_LIKE (last_name, '([aeiou])\1', 'i')
ORDER BY last_name;
Copy
Output Code:
 SELECT last_name
FROM
hr.employees
WHERE
--** SSC-FDM-OR0044 - REGEXP_LIKE_UDF MATCH PARAMETER MAY HAVE SOME FUNCTIONAL DIFFERENCES COMPARED TO ORACLE **
PUBLIC.REGEXP_LIKE_UDF(last_name, '([aeiou])\\1', 'i')
ORDER BY last_name;
Copy
  • If your REGEXP_LIKE condition contains unsupported characters in the user-defined function, consider modifying the regular expression to achieve the same matching behavior without using these characters. For a complete list of unsupported characters, please refer to the REGEXP_LIKE_UDF documentation.

  • For additional assistance, please contact us at snowconvert-support@snowflake.com

SSC-FDM-OR0047

Description

The TIMESTAMP_OUTPUT_FORMAT session parameter should be set to ‘DD-MON-YY HH24.MI.SS.FF AM TZH:TZM’ to ensure timestamps are displayed in the correct format and match the expected output.

Example Code

Input Code:
 SELECT SYSTIMESTAMP FROM DUAL;
Copy
Example of Oracle’s Default TIMESTAMP Format

13-JAN-21 04:18:37.288656 PM UTC

Output Code:
 SELECT
CURRENT_TIMESTAMP() /*** SSC-FDM-OR0047 - YOU MAY NEED TO SET TIMESTAMP OUTPUT FORMAT ('DD-MON-YY HH24.MI.SS.FF AM TZH:TZM') ***/
FROM DUAL;
Copy
How Snowflake Displays TIMESTAMPS by Default

2021-01-13 08:18:19.720 -080

Recommendations

  • To modify how timestamps are displayed in Snowflake, execute this query:

    ALTER SESSION SET TIMESTAMP_OUTPUT_FORMAT = 'DD-MON-YY HH24.MI.SS.FF AM TZH:TZM';
Copy

SSC-FDM-OR0045

Note

This FDM has been deprecated. For more information, please see the documentation for SSC-EWI-OR0010.

Description

This warning appears when PARTITION and SUBPARTITION clauses are used in a query. Snowflake manages data partitioning automatically, so these clauses are not needed.

Example Code

Input Code:
 SELECT * FROM TABLITA PARTITION(col1);
Copy
Output Code:
 SELECT * FROM
TABLITA
--        --** SSC-FDM-OR0045 - PARTITIONS CLAUSES ARE HANDLED BY SNOWFLAKE **
--        PARTITION(col1)
                       ;
Copy

Recommendations

SSC-FDM-OR0046

Note

For better readability, we have simplified some sections of the code in this example.

Description

This warning occurs when a subquery restriction is found within a SELECT statement.

Example Code

Input Code:
 SELECT * FROM LATERAL(SELECT * FROM TABLITA WITH READ ONLY CONSTRAINT T);
Copy
Output Code:
 SELECT * FROM LATERAL(SELECT * FROM
TABLITA
--        --** SSC-FDM-OR0046 - THE SUBQUERY RESTRICTION IS NOT POSSIBLE IN SNOWFLAKE **
--        WITH READ ONLY CONSTRAINT T
                                   );
Copy

Recommendations