SELECT
CaseHeader.caseID,
CaseHeader.caseReference,
CaseHeader.integratedCaseID,
CaseHeader.integratedCaseType,
CaseHeader.caseTypeCode,
CaseHeader.startDate,
CaseHeader.endDate,
CaseHeader.statusCode,
CaseParticipantRole.typeCode
INTO
:caseID,
:caseReference,
:integratedCaseID,
:integratedCaseType,
:caseTypeCode,
:startDate,
:endDate,
:statusCode,
:caseParticipantRoleType
FROM
CaseHeader,
CaseParticipantRole
WHERE CaseHeader.caseID = CaseParticipantRole.caseID
AND CaseParticipantRole.participantRoleID = :participantRoleID
AND
(
CaseParticipantRole.typeCode = :typeCode1
OR CaseParticipantRole.typeCode = :typeCode2
)
AND
(
CaseHeader.startDate >= :startDateFrom
OR :startDateFrom IS NULL
)
AND
(
CaseHeader.startDate <= :startDateTo
OR :startDateTo IS NULL
)
ORDER BY startDate DESC
|