Index: openacs-4/packages/ams/tcl/ams-list-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/tcl/ams-list-procs-postgresql.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ams/tcl/ams-list-procs-postgresql.xql 30 Nov 2005 16:21:53 -0000 1.3.2.2 @@ -0,0 +1,137 @@ + + + + + + + select * + from ams_lists + where list_id = :list_id + + + + + + + select attribute_id + from ams_list_attribute_map + where list_id = :list_id + + + + + + select pretty_name, + description, + description_mime_type + from ams_lists + where list_id = :from_id + + + + + + insert into ams_list_attribute_map + (list_id,attribute_id,sort_order,required_p,section_heading) + ( select :to_id, + attribute_id, + sort_order, + required_p, + section_heading + from ams_list_attribute_map + where list_id = :from_id ) + + + + + + select '1' + from ams_list_attribute_map + where list_id = :to_id + limit 1 + + + + + + select '1' + from ams_lists + where package_key = :package_key + and object_type = :object_type + and list_name = :list_name + + + + + + select list_id + from ams_lists + where package_key = :package_key + and object_type = :object_type + and list_name = :list_name + + + + + + + select ams_list__attribute_map ( + :list_id, + :attribute_id, + :sort_order, + :required_p, + :section_heading + ) + + + + + + select sort_order + from ams_list_attribute_map + where list_id = :list_id + order by sort_order desc + limit 1 + + + + + + delete from ams_list_attribute_map + where list_id = :list_id + and attribute_id = :attribute_id + + + + + + update ams_list_attribute_map + set required_p = 't' + where list_id = :list_id + and attribute_id = :attribute_id + + + + + + update ams_list_attribute_map + set required_p = 'f' + where list_id = :list_id + and attribute_id = :attribute_id + + + + + + select + attribute_id + from + ams_list_attribute_map + where + list_id = :list_id + order by + attribute_id + + + +