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!

Getting trouble with an easy recursive query...

2850214Jan 30 2015 — edited Jan 30 2015

Hi guys, i got a big trouble with this request and i can t find my mistake, if you could help it would be awesome.

i was looking for a solution to my problem and after several topics i found the recursive structure in oracle, but got this error message : What does this mean? ORA-32039: recursive WITH clause must have column alias list.

I changed the structure but still got the same message, even if my WITH have a column alias list.

Here is my code :

WITH parent(MyParent_ID) AS

  ( SELECT Parent_ID FROM ROLE WHERE ID = 1

  ),

  tree AS

  (SELECT x.Parent_ID,

    x.ID

  FROM ROLE x

  INNER JOIN parent

  ON x.Parent_ID = parent.MyParent_ID

  UNION ALL

  SELECT y.Parent_ID,

    y.ID

  FROM ROLE y

  INNER JOIN tree t

  ON y.Parent_ID = t.ID

  )

SELECT Parent_ID, ID FROM tree;

I just want all children for the parameter i enter on line 2.

Thank you.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 27 2015
Added on Jan 30 2015
2 comments
1,701 views