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!

Using sys_connect_by_path while querying from multiple tables

813130Nov 11 2010 — edited Nov 15 2010
Hi guys,

I'm trying to run a query that gets the folder path of each document in the system. Here is what I have:
select sys_connect_by_path(SUBFOLDER.NAME, '/') PATH
from SUBFOLDER, WTDOCUMENT
where WTDOCUMENT.IDA3B2FOLDERINGINFO=SUBFOLDER.IDA2A2
start with SUBFOLDER.IDA3B2FOLDERINGINFO=0
connect by prior SUBFOLDER.IDA2A2=SUBFOLDER.IDA3B2FOLDERINGINFO
Basically, the where condition checks to see if the document's containing folder is equal to the primary key of the subfolder table. If I do the following query:
select SUBFOLDER.NAME
from SUBFOLDER, WTDOCUMENT
where WTDOCUMENTIDA3B2FOLDERINGINFO=SUBFOLDER.IDA2A2
I get the exact amount of results that I expect. However, when I run the first query, I get the empty set. Any idea why my where condition is failing? If I take out the where condition, I will get all the folder paths, but that's not what I want. I just want the folder path in which my document resides.

Any ideas would be greatly appreciated. Thank you!

Edited by: 810127 on Nov 11, 2010 10:58 AM

Edited by: 810127 on Nov 11, 2010 10:58 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2010
Added on Nov 11 2010
4 comments
548 views