SELECT
CaseHeader.caseID,
CaseHeader.caseReference,
CaseHeader.caseTypeCode,
CaseHeader.startDate,
CaseHeader.statusCode,
ConcernRole.concernRoleID,
ConcernRole.concernRoleName,
ConcernRole.concernRoleType
INTO
:caseID,
:caseReference,
:caseTypeCode,
:startDate,
:statusCode,
:concernRoleID,
:concernRoleName,
:concernRoleType
FROM
CaseHeader,
ConcernRole
WHERE CaseHeader.integratedCaseID = :caseID
AND CaseHeader.concernRoleID = :concernRoleID
AND ConcernRole.concernRoleID = CaseHeader.concernRoleID
AND CaseHeader.caseTypeCode = :caseTypeCode
AND ( CaseHeader.statusCode <> :statusCode OR :statusCode IS NULL)
|