postgresql7.1 select mime_type from cr_revisions where item_id = :attach_id and revision_id = content_item__get_latest_revision (:attach_id) delete from images where image_id = content_item__get_latest_revision(:attach_id) FIX ME PLSQL FIX ME PLSQL begin acs_message__delete_image(:attach_id); end; FIX ME PLSQL FIX ME PLSQL begin acs_message__delete_file(:attach_id); end; begin perform content_extlink__delete(:attach_id); return 0; end;