oracle8.1.6
select object_type as ancestor_rel_type
from acs_object_types
where supertype = 'relationship'
and object_type in (
select object_type from acs_object_types
start with object_type = :add_with_rel_type
connect by object_type = prior supertype
)
select case when exists
(select 1 from users where user_id = :user_id)
then 1 else 0 end
from dual
select rowid from users where user_id = :user_id