MSC-PG0012

The current to_char numeric format may fail or have a different behavior in Snowflake.

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

Severity

Medium

Description

This error is added when a numeric format is present in the to_char function because it may fail or have a different behavior in the output format of the function. For more information please refer to PostgreSQL Numeric Formats.

Code Example

Input Code:

SELECT
   to_char(485, 'FMRN'),
   to_char(20+40, 'L999'),
   to_char(-485, '999PR');

Output Code:

SELECT
   to_char(485, 'FMRN') /*** MSC-ERROR - MSC-PG0012 - THE CURRENT TO_CHAR NUMERIC FORMAT MAY FAIL OR HAVE A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/,
   to_char(20+40, 'L999') /*** MSC-ERROR - MSC-PG0012 - THE CURRENT TO_CHAR NUMERIC FORMAT MAY FAIL OR HAVE A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/,
   to_char(-485, '999PR') /*** MSC-ERROR - MSC-PG0012 - THE CURRENT TO_CHAR NUMERIC FORMAT MAY FAIL OR HAVE A DIFFERENT BEHAVIOR IN SNOWFLAKE. ***/;

Recommendations

Last updated