postgresql7.1
select object_id as pid from acs_objects, apm_packages as apmp
where context_id =
(select package_id from dotlrn_communities_all
where community_id = :community_id)
and package_key = 'quota'
and object_id = apmp.package_id;
select attr_value as value from apm_parameter_values
where parameter_id = :param_id and
package_id = :pid
update apm_parameters set
default_value = :value
where parameter_name = :param
update apm_parameter_values
set attr_value = :value
where parameter_id = :param_id and
package_id = :pid
select * from user_quota
where ref_user = :user_id
select content_length from cr_revisions, acs_objects
where revision_id = object_id and
object_type = 'file_storage_object' and
content_length > 0 and
(creation_user = :user_id or modifying_user = :user_id);
select folder_id
from fs_folders
where parent_id = :folder_id
select item_id
from cr_items
where parent_id = :folder_id and
content_type::text = :type_s::text
select revision_id
from cr_revisions
where item_id = :item_id
select content_length as size
from cr_revisions
where revision_id = :revision_id
select community_id from dotlrn_member_rels_approved where user_id = :user_id
select revision_id from cr_revisions where item_id in (select item_id from acs_objects, cr_items where object_type = 'content_item' and content_type = 'file_storage_object' and parent_id = :folder_id and object_id = item_id and (creation_user = :user_id or modifying_user = :user_id));