SELECT
CaseHeader.caseID,
CaseHeader.caseTypeCode,
CaseHeader.startDate,
CaseHeader.statusCode,
ConcernRole.concernRoleID,
ConcernRole.concernRoleName,
ConcernRole.concernRoleType
INTO
:caseID,
:caseTypeCode,
:startDate,
:statusCode,
:concernRoleID,
:concernRoleName,
:concernRoleType
FROM
CaseHeader,
ConcernRole,
CaseUserRole,
OrgObjectLink
WHERE OrgObjectLink.userName = :userName
AND OrgObjectLink.orgObjectLinkID = CaseUserRole.orgObjectLinkID
AND CaseUserRole.caseID = CaseHeader.caseID
AND
(
CaseHeader.caseTypeCode = :caseTypeCode
OR :caseTypeCode IS NULL
)
AND CaseHeader.statusCode <> :statusCode
AND CaseUserRole.typeCode = :typeCode
AND ConcernRole.concernRoleID = CaseHeader.concernRoleID
|