Operation Details
Description: Driving cursor for Approved Product Deliveries Report. The search can be made for a specific date by supplying the from date and leaving the to date empty. The search will be based on a date range if both dates are populated.
Sterotype: nsmulti
SQL
SELECT
  caseApprovalID,
  caseID,
  typeCode,
  requestedDate,
  approvalDate,
  userName,
  decisionId
INTO
  :caseApprovalID,
  :caseID,
  :typeCode,
  :requestedDate,
  :approvalDate,
  :userName,
  :decisionID 
FROM
  CaseApproval 
WHERE userName = :userName 
  AND 
  (
    
    (
      approvalDate = :periodFrom 
      AND :periodTo IS NULL 
    ) 
    OR 
    (
      approvalDate >= :periodFrom 
      AND approvalDate <= :periodTo 
    ) 
  )