Operation Details
Description: Returns a list of case relationships and there caseReference values based on the case ID<br />
Sterotype: nsmulti
SQL
SELECT
  CR.caseID,
  CR.relatedCaseID,
  CR.startDate,
  CR.endDate,
  CR.statusCode,
  CR.typeCode,
  CR.reasonCode,
  CR.caseRelationshipID,
  CR.versionNo,
  CH.caseReference
INTO
  :caseID,
  :relatedCaseID,
  :startDate,
  :endDate,
  :statusCode,
  :typeCode,
  :reasonCode,
  :caseRelationshipID,
  :versionNo,
  :relatedCaseReference 
FROM
  CaseRelationship CR,
  CaseHeader CH 
WHERE CR.caseID = :caseID 
  AND CH.caseID = CR.relatedCaseID 

UNION
  
SELECT
  CR.relatedCaseID,
  CR.caseID,
  CR.startDate,
  CR.endDate,
  CR.statusCode,
  CR.typeCode,
  CR.reasonCode,
  CR.caseRelationshipID,
  CR.versionNo,
  CH.caseReference 
FROM
  CaseRelationship CR,
  CaseHeader CH 
WHERE CR.relatedCaseID = :caseID 
  AND CH.caseID = CR.caseID