SSC-EWI-OR0011

The format parameter is not supported.

Severity

Medium

Description

The format parameter is not currently supported by Snowflake for Cast functions in especial cases. For example, when we use "MONTH" or "DAY" inside the DATE or TIMESTAMP format.

"MONTH/DD/YYYY" or "MM/DAY/YY" ...

Other scenario is when you are working with CAST function using NUMBER currently SnowFlake need to have 4 arguments to show the decimal part, for now the output code not offer all arguments needed for SnowFlake, you need to add the rest arguments for TO_NUMBER function.

Example Code

Input Code:

IN -> Oracle_01.sql
SELECT CAST('12.48' AS NUMBER, '99.99') FROM DUAL;

Output Code:

OUT -> Oracle_01.sql
SELECT
TO_NUMBER('12.48', '99.99', 38, 2)
FROM DUAL;

Input Code:

IN -> Oracle_02.sql
SELECT CAST('FEBRUARY/18/24' as DATE, 'MONTH/DD/YY') FROM DUAL; 
SELECT CAST('FEB/MON/24' as DATE, 'MON/DAY/YY') FROM DUAL;

Output Code:

OUT -> Oracle_02.sql
SELECT
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0011 - THE FORMAT PARAMETER 'MONTH/DD/YY' IS NOT SUPPORTED ***/!!!
TO_TIMESTAMP ('FEBRUARY/18/24' , 'MONTH/DD/YY')
FROM DUAL;

SELECT
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0011 - THE FORMAT PARAMETER 'MON/DAY/YY' IS NOT SUPPORTED ***/!!!
TO_TIMESTAMP ('FEB/MON/24' , 'MON/DAY/YY')
FROM DUAL;

Recommendations

Last updated