SELECT
LiabilityInstrument.liabInstrumentID,
LiabilityInstrument.liabInstructionID,
LiabilityInstrument.creationDate,
LiabilityInstrument.amount,
LiabilityInstrument.periodFromDate,
LiabilityInstrument.periodToDate,
LiabilityInstrument.effectiveDate,
LiabilityInstrument.concernRoleID,
LiabilityInstrument.concernRoleName,
LiabilityInstrument.caseNomineeID,
LiabilityInstrument.nomineeName,
LiabilityInstrument.nomineeAlternateID,
LiabilityInstrument.addressID,
LiabilityInstrument.currencyTypeCode,
LiabilityInstrument.currencyExchangeID,
LiabilityInstruction.finInstructionID
INTO
:liabInstrumentID,
:liabInstructionID,
:creationDate,
:amount,
:periodFromDate,
:periodToDate,
:effectiveDate,
:concernRoleID,
:concernRoleName,
:caseNomineeID,
:nomineeName,
:nomineeAlternateID,
:addressID,
:currencyTypeCode,
:currencyExchangeID,
:finInstructionID
FROM
LiabilityInstrument,
LiabilityInstruction
WHERE LiabilityInstrument.liabInstructionID = LiabilityInstruction.liabInstructionID
AND LiabilityInstrument.concernRoleID = :concernRoleID
AND LiabilityInstrument.liabInstrumentID = :lbyExternalRefNo
AND
(
(
LiabilityInstrument.amount = :amount
OR :amount = 0
)
AND
(
LiabilityInstrument.concernRoleName = :concernRoleName
OR :concernRoleName IS NULL
)
AND
(
LiabilityInstrument.effectiveDate = :effectiveDate
OR :effectiveDate IS NULL
)
AND
(
LiabilityInstrument.periodFromDate >= :periodFromDate
OR :periodFromDate IS NULL
)
AND
(
LiabilityInstrument.periodToDate <= :periodToDate
OR :periodToDate IS NULL
)
)
|