Operation Details
Description: reads the currency exchange records for the specified rate type with start or end date falling between the dates specified. This is used in the auto validate functions to prevent people from entering duplicate currencies of the same type for the same periods in time
Sterotype: nsmulti
SQL
SELECT
  currencyExchangeID,
  currencyTypeCode,
  rate,
  rateFromDate,
  rateToDate,
  statusCode,
  versionNo
INTO
  :currencyExchangeID,
  :currencyTypeCode,
  :rate,
  :rateFromDate,
  :rateToDate,
  :statusCode,
  :versionNo 
FROM
  CurrencyExchange 
WHERE 
  (
    :currencyTypeCode = currencyTypeCode 
  ) 
  AND 
  (
    :statusCode = statusCode 
    OR :statusCode IS NULL 
  ) 
  AND 
  (
    
    (
      :rateToDate >= rateFromDate 
      OR :rateToDate IS NULL 
    ) 
    AND 
    (
      :rateFromDate <= rateToDate 
      OR rateToDate IS NULL 
    ) 
  )