postgresql7.1 select acs_object__name(object_id) as name, type_id from notification_requests where dynamic_p = 'f' and object_id = :object_id order by type_id limit 1