select display_type from as_item_types_map where item_type = 'sa' select r.target_rev_id as as_item_type_id, o.object_type from as_item_rels r, acs_objects o where r.item_rev_id = :as_item_id and r.rel_type = 'as_item_type_rel' and o.object_id = r.target_rev_id update as_item_rels set target_rev_id = :as_item_type_id where item_rev_id = :as_item_id and rel_type = 'as_item_type_rel'