Operation Details
Description: Count all the records by ownerID with case status not equal to the passed status
Sterotype: ns
SQL
SELECT
  COUNT(*)
INTO
  :value 
FROM
  CaseHeader,
  CaseUserRole,
  OrgObjectLink 
WHERE OrgObjectLink.userName = :userName 
  AND OrgObjectLink.orgObjectLinkID = CaseUserRole.orgObjectLinkID 
  AND CaseUserRole.caseID = CaseHeader.caseID 
  AND CaseUserRole.typeCode = :typeCode 
  AND 
  (
    CaseHeader.statusCode <> :statusCode 
  )