Operation Details
Description: Returns a list of the work queues that the specified user can subscribe to (i.e. those they are not already subscribed to) and the specified administrator administers (i.e. the owner of that work queue).
Sterotype: nsmulti
SQL
SELECT
  name,
  wq.workQueueID
INTO
  :name,
  :workQueueID 
FROM
  WorkQueue WQ 
WHERE 
  (
    
    (
      WQ.administratorUserName = :administratorUserName 
    ) 
    OR 
    (
      WQ.allowUserSubscriptionInd = '1' 
      AND 
      (
        WQ.sensitivity <= 
        ( 
        SELECT
          sensitivity 
        FROM
          Users 
        WHERE userName = :administratorUserName 
        ) 
      ) 
    ) 
  ) 
  AND WQ.workQueueID NOT IN 
  ( 
  SELECT
    workQueueID 
  FROM
    WorkQueueSubscription WQS 
  WHERE WQS.userName = :userName 
  )