postgresql7.1 select file_storage__get_root_folder(:package_id); select file_storage__get_folder_name(:folder_id); select count(*) from cr_items where item_id in (select item_id from cr_items where tree_sortkey like (select tree_sortkey || '%' from cr_items where item_id = :item_id) order by tree_sortkey) and acs_permission__permission_p(item_id,:user_id,:privilege) = 'f' select item_id as child_item_id from cr_items where tree_sortkey like (select tree_sortkey || '%' from cr_items where item_id = :item_id) order by 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 where j.item_id not in (select o2.item_id from cr_items o1, cr_items o2 where o1.item_id = file_storage__get_root_folder([ad_conn package_id]) and o2.tree_sortkey <= o1.tree_sortkey and o1.tree_sortkey like (o2.tree_sortkey || '%') ) and i.item_id = :start_id and j.tree_sortkey <= i.tree_sortkey and i.tree_sortkey like (j.tree_sortkey || '%') order by j.tree_sortkey asc