select 
 u.uco_DESC as DESCRIPTION,
 u.uco_code as WOTYPE
FROM  
r5userorganization o, r5ucodes u WHERE  o.uog_org = <control.organization> 
AND o.uog_user = <parameter.r5user>  
AND u.uco_rentity = 'JBTP' AND 
u.uco_rcode IN ('*','BR','RP','ST','CAL') AND ( (EXISTS ( SELECT 'x' from r5jobtypeauth j  
WHERE  u.uco_code = j.jta_jobtype AND  ( j.jta_group = o.uog_group OR j.jta_group = '*' )  
AND j.jta_insert = '+') ) OR EXISTS ( SELECT 'x'  FROM r5install i  WHERE i.ins_code = 'JTAUTH'  
AND UPPER( i.ins_desc ) NOT IN ( 'YES', '+' ) ) ) 
                      