oracle8.1.6
select
object_type, pretty_name,
content_item.get_title(:item_id) name
from
acs_object_types
where
object_type = content_item.get_content_type(:item_id)
select
template_id, use_context,
content_item.get_path( template_id ) path,
cms_permission.permission_p( template_id, :user_id, 'cm_examine')
as can_read_template
from
cr_item_template_map t
where
t.item_id = :item_id
order by
path, use_context
select
template_id, use_context, is_default,
content_item.get_path( template_id ) path,
cms_permission.permission_p( template_id, :user_id, 'cm_examine')
as can_read_template,
(select 1
from
cr_item_template_map itmap
where
itmap.template_id = t.template_id
and
itmap.use_context = t.use_context
and
itmap.item_id = :item_id) already_registered_p
from
cr_type_template_map t
where
t.content_type = :content_type
order by
path, use_context