SSC-EWI-OR0047
TO_NCHAR transformed to TO_VARCHAR, it may not be compilable in Snowflake.
Severity
Low
Description
This warning is added when the function TO_NCHAR
was found and it was transformed into a TO_VARCHAR
function.
There are multiple cases where the transformation causes a compilation error, or the output is not the same.
Example Code
Input Code:
select TO_NCHAR(sysdate,'DY','nls_date_language=english') from dual
Output Code:
select
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0047 - TO_NCHAR TRANSFORMED TO TO_VARCHAR, IT MAY NOT BE COMPILABLE IN SNOWFLAKE ***/!!!
TO_VARCHAR(CURRENT_TIMESTAMP(),'DY','nls_date_language=english') from dual;
The example from above will result in an error if it is used in Snowflake.
Not all cases are causing errors.
Input Code:
SELECT TO_NCHAR(SYSDATE, 'YYYY-MM-DD') FROM dual;
Output Code:
SELECT
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0047 - TO_NCHAR TRANSFORMED TO TO_VARCHAR, IT MAY NOT BE COMPILABLE IN SNOWFLAKE ***/!!!
TO_VARCHAR(CURRENT_TIMESTAMP(), 'YYYY-MM-DD') FROM dual;
The last example does not cause an error in Snowflake, and the output is equivalent if executed.
Recommendations
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
Last updated