Database SQL Operation: CaseNomineeObjective.readEarliestCaseNomObjective
Description: | Reads earliest all CaseNomineeObjective records on a case with the fromCaseStartDateInd set to true for a rules objective. |
Sterotype: | ns |
SELECT
CaseNomineeObjective.caseNomineeObjectiveID,
CaseNomineeObjective.fromDate,
CaseNomineeObjective.fromCaseStartDateInd,
CaseNomineeObjective.caseNomineeID
INTO
:caseNomineeObjectiveID,
:fromDate,
:fromCaseStartDateInd,
:caseNomineeID
FROM
CaseNomineeObjective,
CaseNominee,
CaseParticipantRole
WHERE CaseNomineeObjective.fromDate =
(
SELECT
MIN ( CaseNomineeObjective.fromDate )
FROM
CaseNomineeObjective,
CaseNominee,
CaseParticipantRole
WHERE CaseNomineeObjective.rulesObjectiveID = :rulesObjectiveID
AND CaseParticipantRole.caseID = :caseID
AND CaseNomineeObjective.statusCode = :statusCode
AND CaseParticipantRole.caseParticipantRoleID = CaseNominee.caseParticipantRoleID
AND CaseNomineeObjective.caseNomineeID = CaseNominee.caseNomineeID
)
AND CaseParticipantRole.caseID = :caseID
AND CaseNomineeObjective.statusCode = :statusCode
AND CaseParticipantRole.caseParticipantRoleID = CaseNominee.caseParticipantRoleID
AND CaseNomineeObjective.caseNomineeID = CaseNominee.caseNomineeID
AND CaseNomineeObjective.rulesObjectiveID = :rulesObjectiveID
|