SELECT
CaseEvidence.evidenceID,
CaseEvidence.caseID,
CaseEvidence.assessmentID,
CaseEvidence.effectiveFrom,
CaseEvidence.statusCode,
CaseEvidence.versionNo,
CaseEvidenceType.caseEvidenceTypeID,
CaseEvidenceType.evidenceTypeCode,
CaseEvidenceType.evidenceFormName,
CaseEvidenceType.statusCode,
CaseEvidenceType.versionNo
INTO
:evidenceID,
:caseID,
:assessmentID,
:effectiveFrom,
:statusCode,
:caseEvidenceVersionNo,
:caseEvidenceTypeID,
:evidenceTypeCode,
:evidenceFormName,
:evidenceTypeStatusCode,
:caseEvidenceTypeVersionNo
FROM
CaseEvidence,
CaseEvidenceType
WHERE CaseEvidence.caseID = :caseID
AND
(
CaseEvidence.assessmentID = :assessmentID
OR CaseEvidence.assessmentID IS NULL
)
AND
(
CaseEvidence.statusCode = :statusCode
OR CaseEvidence.statusCode = :statusCode2
)
AND CaseEvidenceType.evidenceID = CaseEvidence.evidenceID
AND CaseEvidenceType.evidenceTypeCode = :evidenceTypeCode
|