select <param.headerEquipDirection> as code, uco_desc as description from r5ucodes
where uco_rentity='LDIR'
and uco_code=<param.headerEquipDirection>
union
SELECT CASE WHEN (ldr_oppositedirection = <param.headerEquipDirection>) THEN ldr_direction ELSE ldr_oppositedirection END  as code,
(select uco_desc from r5ucodes where uco_rentity = 'LDIR' AND uco_code=CASE WHEN (ldr_oppositedirection =<param.headerEquipDirection>) THEN ldr_direction ELSE ldr_oppositedirection END) AS description
FROM R5LINEARDIRECTIONS
