Links

MSCEWI1077

Cycle found between CTE calls. CTEs cannot be ordered.

Severity

Low

Description

This warning is added when a query that has several CTE (Common Table Expression) reference calls creates a cycle that cannot determine the calling order of the CTEs, and then the CTEs cannot be ordered and the query will remain as the original source.

Example Code

Teradata:

WITH t1(c1) as (SELECT c1 FROM t2),
t2(c2) as (SELECT c2 FROM t3),
RECURSIVE t3(c3) as (SELECT c3, someOtherColumn FROM t1, t3)
SELECT * FROM t1;

Snowflake:

/*** MSC-WARNING - MSCEWI1077 - CYCLE FOUND BETWEEN CTE REFERENCE CALLS, CTES CANNOT BE ORDERED AND THE QUERY WILL REMAIN AS ORIGINAL ***/
WITH RECURSIVE t1(c1) AS
(
SELECT c1 FROM t2
),
t2(c2) AS
(
SELECT c2 FROM t3
),
t3(c3) AS
(
SELECT c3, someOtherColumn FROM t1, t3
)
SELECT * FROM t1;

Recommendations

  • No additional user actions are required.
  • For more support, you can email us at [email protected] or post a message to our forums. If you have a contract for support with Mobilize.Net, reach out to your sales engineer and they can direct your support needs.