Operation Details
Description: Returns the number of unreserved tasks for an organizational object.
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 ta.taskID = t.taskID 
  AND t.reservedBy IS NULL