Operation Details
Description: This method is used as the driving cursor for the EvaluateCertificationGracePeriod batch job. The `order by` in the SQL statement is important to the processing in this batch program, i.e.. processing will only occur on records with the maximum periodToDate per caseID. Therefore, based on the SQL, only the first record per caseID will be processed. This approach was taken since the SQL to produce the 'correct' result set was using a lot of business logic and would make this batch job difficult to maintain/customize.
Sterotype: nsmulti
SQL
SELECT
  caseID,
  certificationReceivedDate,
  periodFromDate,
  periodToDate,
  documentRefNumber,
  fileRefNumber,
  certificationDiaryID,
  comments,
  statusCode
INTO
  :caseID,
  :certificationReceivedDate,
  :periodFromDate,
  :periodToDate,
  :documentRefNumber,
  :fileRefNumber,
  :certificationDiaryID,
  :comments,
  :statusCode 
FROM
  ProductDeliveryCertDiary 
WHERE statusCode <> :cancelledStatus 
ORDER BY caseID ASC,
  periodToDate DESC