Operation Details
Description: Counts active caseUserRole records for the specified hearing, with the given userName, typeCode and recordStatus (active).
Sterotype: ns
SQL
SELECT
  COUNT(hearingUserRoleID)
INTO
  :numberOfRecords 
FROM
  HearingUserRole,
  CaseUserRole CUR,
  OrgObjectLink OBL 
WHERE hearingID = :hearingID 
  AND HearingUserRole.caseUserRoleID = CUR.caseUserRoleID 
  AND CUR.typeCode = :typeCode 
  AND OBL.userName = :userName 
  AND CUR.orgObjectLinkID =OBL.orgObjectLinkID 
  AND recordStatus = :recordStatus