SELECT
CaseEvidence.evidenceID,
CaseEvidence.caseID,
CaseEvidence.effectiveFrom,
CaseEvidence.statusCode,
CaseEvidence.versionNo
INTO
:evidenceID,
:caseID,
:effectiveFrom,
:statusCode,
:versionNo
FROM
CaseEvidence,
CaseHeader
WHERE
(
CaseEvidence.caseID = CaseHeader.integratedCaseID
OR CaseEvidence.caseID = CaseHeader.caseID
)
AND CaseHeader.caseID = :caseID
AND EXISTS
(
SELECT
*
FROM
CaseEvidenceType,
CaseEvidence,
EvidenceForm,
ProductEvidenceFormLink
WHERE CaseEvidenceType.evidenceID = CaseEvidence.evidenceID
AND
(
ProductEvidenceFormLink.productID = :productID
OR :productIDIsNull <> '0'
)
AND EvidenceForm.evidenceFormID = ProductEvidenceFormLink.evidenceFormID
AND EvidenceForm.evidenceNameCode = CaseEvidenceType.evidenceFormName
)
|