select acc_code as actioncode,
 acc_desc as actiondesc
 from r5actioncodes a 
 where coalesce(acc_notused, '-') = '-' 
 and coalesce(acc_partfailure, '-') = '-' 
 and (coalesce(a.acc_gen,'-') = '+' 
   or exists ( select 1 from r5actclasses where acc_code = acl_action and acl_class = <param.objclass> and acl_class_org= <param.objclassorg>))
   order by acc_code ASC
