MSCEWI3116

Operations between Intervals are not supported

Severity

Medium

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:

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:

SELECT

/*** MSC-ERROR - MSCEWI3116 - OPERATIONS BETWEEN INTERVALS ARE NOT SUPPORTED BY SNOWFLAKE ***/
/*INTERVAL '1-1 year' + INTERVAL '1y, 1mm' + INTERVAL '1y, 1mm'*/
null
FROM dual;

SELECT
/*** MSC-ERROR - MSCEWI3116 - OPERATIONS BETWEEN INTERVALS ARE NOT SUPPORTED BY SNOWFLAKE ***/
/*INTERVAL '1y, 1mm' + INTERVALCOLUMN*/
null
FROM PUBLIC.INTERVALTABLE;

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