select f.fal_code as failurecode,
 f.fal_desc as failuredesc
 from r5failures f 
 where coalesce(fal_notused, '-') = '-' 
 and coalesce(fal_partfailure, '-') = '-' 
 and (coalesce(f.fal_gen,'-') = '+'  
   or exists ( select 1 from r5failureclasses where fal_code = fca_failure and fca_class = <param.objclass> and fca_class_org= <param.objclassorg> ))
   order by fal_code asc
