postgresql7.1
select file_storage__get_root_folder(:package_id);
select file_storage__get_folder_name(:folder_id);
select count(*)
from cr_items c1, cr_items c2
where c2.item_id = :item_id
and c1.tree_sortkey between c2.tree_sortkey and tree_right(c2.tree_sortkey)
and not acs_permission__permission_p(c1.item_id,:user_id,:privilege)
select c1.item_id as child_item_id
from cr_items c1, cr_items c2
where c2.item_id = :item_id
and c1.tree_sortkey between c2.tree_sortkey and tree_right(c2.tree_sortkey)
order by c1.tree_sortkey
select count(*)
from cr_revisions
where item_id = :child_item_id
and acs_permission__permission_p(revision_id,:user_id,:privilege) = 'f'
select file_storage__get_title(:item_id)
select (case when file_storage__get_content_type(j.item_id) = 'content_folder'
then 'index?folder_id='
else 'file?file_id='
end) || j.item_id,
file_storage__get_title(j.item_id)
from cr_items i, cr_items j, cr_items k
where i.item_id = :start_id
and k.item_id = file_storage__get_root_folder([ad_conn package_id])
and j.tree_sortkey between tree_left(k.tree_sortkey) and i.tree_sortkey
and tree_ancestor_p(j.tree_sortkey, i.tree_sortkey)
order by j.tree_sortkey asc