SELECT
CaseHeader.caseID,
CaseHeader.planID,
CaseHeader.concernRoleID,
CaseHeader.ownerOrgObjectLinkID,
CaseHeader.registrationDate,
CaseHeader.caseReference,
CaseHeader.expectedStartDate,
CaseHeader.expectedEndDate,
CaseHeader.startDate,
CaseHeader.endDate,
CaseHeader.effectiveDate,
CaseHeader.statusCode,
CaseHeader.classificationCode,
CaseHeader.priorityCode,
CaseHeader.objectiveCode,
CaseHeader.appealIndicator,
CaseHeader.outcomeCode,
CaseHeader.comments,
CaseHeader.caseTypeCode,
CaseHeader.receivedDate,
CaseHeader.defaultDeliveryMethodType,
CaseHeader.defaultCurrencyTypeCode,
CaseHeader.firstReviewDate,
CaseHeader.versionNo
INTO
:caseID,
:planID,
:concernRoleID,
:ownerOrgObjectLinkID,
:registrationDate,
:caseReference,
:expectedStartDate,
:expectedEndDate,
:startDate,
:endDate,
:effectiveDate,
:statusCode,
:classificationCode,
:priorityCode,
:objectiveCode,
:appealIndicator,
:outcomeCode,
:comments,
:caseTypeCode,
:receivedDate,
:defaultDeliveryMethodType,
:defaultCurrencyTypeCode,
:firstReviewDate,
:versionNo
FROM
CaseHeader
WHERE CaseHeader.concernRoleID = :concernRoleID
AND
(
CaseHeader.startDate >= :startDateFrom
OR :startDateFrom IS NULL
)
AND
(
CaseHeader.startDate <= :startDateTo
OR :startDateTo IS NULL
)
AND NOT CaseHeader.statusCode = :statusCode
ORDER BY startDate DESC
|