oracle8.1.6 select rel_constraint.violation(:rel_id) from dual begin ${package_name}.del(:rel_id); end; select pretty_name, object_type, indent, case when valid_types.rel_type = null then 0 else 1 end as valid_p from (select t.pretty_name, t.object_type, replace(lpad(' ', (level - 1) * 4), ' ', ' ') as indent, rownum as tree_rownum from acs_object_types t connect by prior t.object_type = t.supertype start with t.object_type = :start_with ) types, (select rel_type from rc_valid_rel_types where group_id = :group_id ) valid_types where types.object_type = valid_types.rel_type(+) order by tree_rownum