SELECT
InstructionLineItem.instructLineItemID,
InstructionLineItem.amount,
InstructionLineItem.instructLineItemCategory,
InstructionLineItem.instructionLineItemType,
InstructionLineItem.financialCompID,
InstructionLineItem.coverPeriodFrom,
InstructionLineItem.coverPeriodTo,
InstructionLineItem.statusCode,
InstructionLineItem.deliveryMethodType,
CaseNominee.caseNomineeID
INTO
:instructLineItemID,
:amount,
:instructLineItemCategory,
:instructionLineItemType,
:financialCompID,
:coverPeriodFrom,
:coverPeriodTo,
:statusCode,
:deliveryMethodType,
:caseNomineeID
FROM
InstructionLineItem,
CaseNominee
WHERE InstructionLineItem.caseID = :caseID
AND InstructionLineItem.caseNomineeID = CaseNominee.caseNomineeID
AND (InstructionLineItem.coverPeriodFrom <= :coverPeriodTo
OR :coverPeriodTo IS NULL)
AND InstructionLineItem.coverPeriodTo >= :coverPeriodFrom
ORDER BY InstructionLineItem.coverPeriodFrom,
InstructionLineItem.coverPeriodTo,
CaseNominee.caseNomineeID
|