The first one contains a single row for each privilege, and the second one contains one row for each parent-child relationship, e.g. one for admin->read. That means that there is no row for the leaf nodes (those that have no children) in the acs_privilege_hierarchy table, they only have one entry in acs_privileges. I need a query that returns one row for each privilege, including the hierarchy level and in the order of the hierarchy.
Therefor I created a join that produces a resultset with a parent_privilege field which is null in case the row represents a top level node. Trying to do a 'connect by' on this query fails though:
select q.privilege, level from
(select p.privilege, h.privilege as parent_privilege
from acs_privileges p, acs_privilege_hierarchy h
where p.privilege=h.child_privilege(+) ) q
connect by prior q.privilege=q.parent_privilege;
with this error:
ERROR at line 1:
ORA-01437: cannot have join with CONNECT BY
Google says this restriction was removed with 9i, but I couldn't find a suggestion how to circumvent it for this particular case when 8i has to be used.
Any ideas how I can get the privileges tree with the current datamodel using oracle 8i?
Request notifications