SSC-EWI-OR0116

Operations between Intervals are not supported

Severity

Medium

Some parts of the output code are omitted for clarity reasons.

Description

This error is added when there is an arithmetical operation whose operands are only intervals, this kind of operation is not supported by Snowflake.

Example Code

Input Code:

IN -> Oracle_01.sql
SELECT INTERVAL '1-1' YEAR(2) TO MONTH + INTERVAL '1-1' YEAR(2) + INTERVAL '1-1' YEAR(2) TO MONTH FROM dual;

SELECT INTERVALCOLUMN + INTERVAL '1-1' YEAR(2) TO MONTH FROM INTERVALTABLE;

Output Code:

OUT -> Oracle_01.sql
SELECT
--INTERVAL '1-1 year' + INTERVAL '1y, 1mm' + INTERVAL '1y, 1mm'
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0116 - OPERATIONS BETWEEN INTERVALS ARE NOT SUPPORTED BY SNOWFLAKE ***/!!!
null
FROM dual;


SELECT
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0036 - TYPES RESOLUTION ISSUES, ARITHMETIC OPERATION '+' MAY NOT BEHAVE CORRECTLY BETWEEN Unknown AND Interval ***/!!! INTERVALCOLUMN + INTERVAL '1y, 1mm'
FROM
INTERVALTABLE;
  1. SSC-EWI-0ROO36: Types resolution issues, the arithmetic operation may not behave correctly between string and date.

Recommendations

  • Depending on where the operation is located, it could be relocated and made valid by adding dates or timestamps.

  • If you need more support, you can email us at snowconvert-support@snowflake.com

Last updated