SELECT
SpecialCaution.concernRoleID,
SpecialCaution.specialCautionID,
SpecialCaution.specialCautionTypeCode,
SpecialCaution.startDate,
SpecialCaution.endDate,
SpecialCaution.comments,
SpecialCaution.recordStatus
INTO
:concernRoleID,
:specialCautionID,
:typeCode,
:startDate,
:endDate,
:comments,
:recordStatus
FROM
SpecialCaution
WHERE SpecialCaution.concernRoleID = :concernRoleID
AND
(
SpecialCaution.recordStatus = :recordStatus
AND SpecialCaution.endDate IS NOT NULL
OR SpecialCaution.recordStatus = :newRecordStatus
)
|