Operation Details
Description:  
Sterotype: nsmulti
SQL
SELECT
SubQuery.concernRoleName,
SubQuery. caseParticipantRoleID
 INTO
   :name,
   :caseParticipantRoleID 
 FROM
( (SELECT
  concernRoleName,
   caseParticipantRoleID
  FROM
   ConcernRole,
   CaseParticipantRole,
   Person
 WHERE CaseParticipantRole.caseID = :caseID 
   AND 
   (
     CaseParticipantRole.typeCode = :type1 
     OR CaseParticipantRole.typeCode = :type2 
   ) 
   AND ConcernRole.concernRoleID = CaseParticipantRole.participantRoleID
   AND CaseParticipantRole.recordStatus = :recordStatus
   AND 
    (
       Person.concernRoleID = ConcernRole.concernRoleID 
       AND Person.dateOfBirth >= :dateFrom 
    ) )
 UNION
 ( 
   SELECT
     concernRoleName,
      caseParticipantRoleID
      FROM
     ConcernRole,
     CaseParticipantRole,
     ProspectPerson
   WHERE CaseParticipantRole.caseID = :caseID 
     AND 
     (
       CaseParticipantRole.typeCode = :type1 
       OR CaseParticipantRole.typeCode = :type2 
     ) 
     AND ConcernRole.concernRoleID = CaseParticipantRole.participantRoleID 
     AND CaseParticipantRole.recordStatus = :recordStatus
     AND ProspectPerson.concernRoleID = ConcernRole.concernRoleID 
    )
    ) SubQuery