Operation Details
Description: Search of Payment Instrument by partial match concernRoleName and/or a combination of all other input fields
Sterotype: nsmulti
SQL
SELECT
  PaymentInstrument.pmtInstrumentID,
  PaymentInstrument.amount,
  PaymentInstrument.effectiveDate,
  PaymentInstrument.creationDate,
  PaymentInstrument.deliveryMethodType,
  PaymentInstrument.reconcilStatusCode,
  PaymentInstrument.concernRoleID,
  PaymentInstrument.concernRoleName,
  PaymentInstrument.caseNomineeID,
  PaymentInstrument.nomineeName,
  PaymentInstrument.nomineeAlternateID,
  PaymentInstrument.addressID,
  PaymentInstrument.currencyTypeCode,
  PaymentInstrument.currencyExchangeID,
  PaymentInstrument.bankAccountID,
  PaymentInstrument.referenceNumber,
  PaymentInstrument.referenceText,
  PaymentInstrument.pslipInstructionID,
  PaymentInstruction.finInstructionID
INTO
  :pmtInstrumentID,
  :amount,
  :effectiveDate,
  :creationDate,
  :deliveryMethodType,
  :reconcilStatusCode,
  :concernRoleID,
  :concernRoleName,
  :caseNomineeID,
  :nomineeName,
  :nomineeAlternateID,
  :addressID,
  :currencyTypeCode,
  :currencyExchangeID,
  :bankAccountID,
  :referenceNumber,
  :referenceText,
  :pslipInstructionID,
  :finInstructionID 
FROM
  PaymentInstrument,
  PaymentInstruction 
WHERE PaymentInstrument.pmtInstrumentID = PaymentInstruction.pmtInstrumentID 
  AND UPPER(PaymentInstrument.concernRoleName) LIKE :concernRoleName 
  AND 
  (
    
    (
      PaymentInstrument.amount = :amount 
      OR :amount = 0 
    ) 
    AND 
    (
      PaymentInstrument.deliveryMethodType = :deliveryMethodType 
      OR :deliveryMethodType IS NULL 
    ) 
    AND 
    (
      PaymentInstrument.reconcilStatusCode = :statusCode 
      OR :statusCode IS NULL 
    ) 
    AND 
    (
      PaymentInstrument.effectiveDate >= :effectiveDateFrom 
      OR :effectiveDateFrom IS NULL 
    ) 
    AND 
    (
      PaymentInstrument.effectiveDate <= :effectiveDateTo 
      OR :effectiveDateTo IS NULL 
    ) 
  )