Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Join on hierarchy query using the root element possible?
Sybrand Bakker <sybrandb_at_hccnet.nl> wrote in message news:<6b5rl0ls3uj4p68nc7ucparls9bf8r120o_at_4ax.com>...
> On 1 Oct 2004 03:37:38 -0700, schreurs_roel_at_hotmail.com (Roel
> Schreurs) wrote:
>
> >Does something like that exist? Or does anybody know another way to
> >achieve this?
>
>
> Does your database have a version? The answer may be version
> dependent.
>
> Hint: connect by queries are allowed in subqueries, just transform
> your join to a subquery.
The oldest Oracle database version I need to comply with is 8.1.7, but if a higher version supports an alternative, I would be pleased to know it, for the future.
I understand that connect by queries can be used in sub queries, but I cannot see how I could join them correctly. The hierarchy must be joined at 'root' elements to the permissions table. However, as I explained in my question, I do not know how to get hold on the root element.
The table HIERARCHIE stores the following: 'ROOT'
'A' 'AA' 'B'
Since U1 is granted for 'ROOT', I should be able to calculate the following implicit permissions:
U1 'ROOT' U1 'A' U1 'AA' U1 'B' U2 is granted for 'A', which would imply: U2 'A' U2 'AA' To achieve this, I need all sub trees as follows: ROOT NODE LEVEL 'ROOT' 'ROOT' 1 'ROOT' 'A' 2 'ROOT' 'AA' 3 'ROOT' 'B' 2 'A' 'A' 1 'A' 'AA' 2 'AA' 'AA' 1 'B' 'B' 1
I hope this clarifies my question.
Roel Schreurs Received on Sun Oct 03 2004 - 04:23:29 CDT