postgresql7.1
select rel_constraint__violation(:rel_id)
select ${package_name}__delete(:rel_id) from dual
select
pretty_name, object_type, level, indent,
case when valid_types.rel_type = null then 0 else 1 end as valid_p
from
(select
t2.pretty_name, t2.object_type, tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) as level,
repeat(' ', (tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey)) * 4) as indent,
t2.tree_sortkey as sortkey
from
acs_object_types t1,
acs_object_types t2
where t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)
and t1.object_type = :start_with) types left join
(select
rel_type
from
rc_valid_rel_types
where
group_id= :group_id) valid_types
on (types.object_type = valid_types.rel_type)
order by sortkey