Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-30654: "missing DEFAULT keyword" in recursive subquery factoring

_jumFeb 14 2014 — edited Feb 14 2014

The recursive subquery factoring works without CYCLE clause and without cycle only.

When I have a cycle (uncomment SELECT 5, 2 FROM dual UNON ALL) ORACLE detects the cycle correctly, but when I include CYCLE clause I get ORA-30654.

I' m pretty shure, that this statement already worked in my DB (11.2.0.3.0 - 64bit)

CREATE TABLE temp_rsq (a,b)

AS

SELECT 1, 2 FROM dual UNION ALL

SELECT 2, 3 FROM dual UNION ALL

SELECT 3, 4 FROM dual UNION ALL

SELECT 4, 5 FROM dual UNION ALL

--SELECT 5, 2 FROM dual UNION ALL

SELECT 5, 6 FROM dual UNION ALL

SELECT 6, 7 FROM dual;

--

--

-- b-> new A

WITH cte (  pb, a,    b,      weg) AS

(SELECT   NULL, a,    b,        a

   FROM temp_rsq

  WHERE a=1

UNION ALL

SELECT cte.b, n.a a, n.b, weg+n.a

   FROM temp_rsq n

   JOIN cte

     ON (cte.b=n.a))

SEARCH depth FIRST BY a SET abst

--CYCLE a SET is_cycle to '1' DEFAULT '0'

SELECT * FROM cte;


This post has been answered by _jum on Feb 14 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2014
Added on Feb 14 2014
9 comments
5,145 views