SELECT CGO.CGO_CAMPAIGN, CGO.CGO_CAMPAIGN_ORG, CGO.CGO_OBJECT, CGO.CGO_OBJECT_ORG, CGO.CGO_STATUS, UCO.UCO_DESC, CGO.CGO_EVENT, CGO.CGO_MESSAGE, CGO.CGO_ERRORCODE,
OBJ.OBJ_DESC, OBJ.OBJ_MRC, OBJ.OBJ_CLASS, OBJ.OBJ_LOCATION, OBJ.OBJ_CATEGORY, CGO.DMLTYPE
FROM R5CAMPAIGNOBJECTS CGO, R5OBJECTS OBJ, R5UCODES UCO
WHERE OBJ.OBJ_CODE = CGO.CGO_OBJECT AND UCO.UCO_CODE = CGO.CGO_STATUS AND UCO.UCO_ENTITY = 'ECST' AND CGO.CGO_EVENT = <param.event>
ORDER BY CASE CGO_STATUS WHEN 'NE' THEN 1 WHEN 'F' THEN 2 WHEN 'P' THEN 3 END, CGO.CGO_OBJECT, CGO.CGO_OBJECT_ORG;
