Operation Details
Description: Searches all case evidence tree records for a specified effectiveFrom date and caseID.
Sterotype: nsmulti
SQL
SELECT
  CaseEvidenceTree.caseEvidenceTreeID,
  CaseEvidenceTree.caseID,
  CaseEvidenceTree.effectiveFrom,
  CaseEvidenceTree.statusCode,
  CaseEvidenceTree.previousEvidenceID,
  CaseEvidenceTree.versionNo
INTO
  :caseEvidenceTreeID,
  :caseID,
  :effectiveFrom,
  :statusCode,
  :previousEvidenceID,
  :versionNo 
FROM
  CaseEvidenceTree 
WHERE CaseEvidenceTree.caseID = :caseID 
  AND 
  (
    
    (
      CaseEvidenceTree.effectiveFrom = :effectiveFrom 
      AND :useDateInd <> '0' 
    ) 
    OR 
    (
      CaseEvidenceTree.effectiveFrom IS NULL 
      AND :useDateInd = '0' 
    ) 
  ) 
ORDER BY caseID,
  effectiveFrom,
  statusCode