1

Say i have the following table, using Oracle 10g

 ARTIFACT_LABEL |   DEPENDANT_ON
 test1          |   abc1
 test1          |   abc2
 test1          |   abc3
 abc3           |   xyz1
 abc4           |   xyz2

and i want to generate a tree structure knowing what test1 depends on, (so i want to return, abc1, abc2, abc3, xyz1) ive been using the following:

SELECT ARTIFACT_LABEL, DEPENDANT_ON FROM DEPENDANCIES START WITH ARTIFACT_LABEL = 'test1' CONNECT BY NOCYCLE PRIOR ARTIFACT_LABEL = DEPENDANT_ON

But this isnt working (it seems to just be doing a SELECT where ARTIFACT_LABEL = 'test1')

Any ideas where im going wrong?

1 Answer 1

1

Since you are starting at the bottom of the tree and working up, change the last part of the query to:

PRIOR DEPENDANT_ON = ARTIFACT_LABEL
Sign up to request clarification or add additional context in comments.

1 Comment

Just found this out a few minutes after posting the question - should stop being lazy and do all the testing myself before asking others. Thanks for the help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.