select rqm_code as problemcode, rqm_desc as description
       from r5requircodes r  where  coalesce(rqm_notused, '-') = '-' and coalesce(rqm_partfailure, '-') = '-'  and
       (r.rqm_gen='+' or 
       (r.rqm_gen='-' and exists 
       (select null from  r5reqclasses rr where 
       rr.rcl_reqm = r.rqm_code and
       rr.rcl_class = <param.objclass> and
       rr.rcl_class_org= <param.objclassorg>)))
order by rqm_code asc
                      
