select 1 from attachments_fs_root_folder_map where package_id = :package_id select folder_id from attachments_fs_root_folder_map where package_id = :package_id insert into attachments_fs_root_folder_map (package_id, folder_id) values (:package_id, :folder_id) delete from attachments_fs_root_folder_map where package_id = :package_id and folder_id = :folder_id insert into attachments (object_id, item_id) values (:object_id, :attachment_id) delete from attachments where object_id = :object_id and item_id = :attachment_id select item_id, acs_object.name(item_id) from attachments where object_id= :object_id