Operation Details
Description: Counts non-closed and non-completed tasks based on relatedID, assigneeType and TaskID.
Sterotype: ns
SQL
SELECT
  count(*)
INTO
  :numberOfRecords 
FROM
  TaskAssignment ta,
  Task t 
WHERE 
  (
    :searchByRelatedIDInd = '0' 
    OR ta.relatedID = :relatedID 
  ) 
  AND 
  (
    :relatedName IS NULL 
    OR ta.relatedName = :relatedName 
  ) 
  AND ta.assigneeType = :assigneeType 
  AND t.taskID = ta.taskID