Operation Details
Description:  
Sterotype: nsmulti
SQL
SELECT
  Person.concernRoleID,
  Person.personBirthName,
  Person.dateOfBirth,
  Person.dateOfDeath,
  Person.gender,
  Person.specialInterestCode,
  Person.maritalStatusCode,
  Person.nationalityCode,
  Person.residencyAbroadInd,
  Person.motherBirthSurname,
  Person.comments,
  Person.type,
  Person.dateOfBirthVerInd,
  Person.dateOfDeathVerInd,
  Person.primaryAlternateID,
  Person.countryOfBirth,
  Person.placeOfBirth,
  Person.pinNumber,
  Person.primaryAlternateNameID,
  Person.ethnicOriginCode,
  Person.paymentFrequency,
  Person.nextPaymentDate,
  Person.currencyType,
  Person.methodOfPmtCode,
  Person.versionNo
INTO
  :concernRoleID,
  :personBirthName,
  :dateOfBirth,
  :dateOfDeath,
  :gender,
  :specialInterestCode,
  :maritalStatusCode,
  :nationalityCode,
  :residencyAbroadInd,
  :motherBirthSurname,
  :comments,
  :type,
  :dateOfBirthVerInd,
  :dateOfDeathVerInd,
  :primaryAlternateID,
  :countryOfBirth,
  :placeOfBirth,
  :pinNumber,
  :primaryAlternateNameID,
  :ethnicOriginCode,
  :paymentFrequency,
  :nextPaymentDate,
  :currencyType,
  :methodOfPmtCode,
  :versionNo 
FROM
  Person,
  ConcernRole,
  AlternateName,
  Address,
  ConcernRoleAddress 
WHERE 
  (
    :searchByFirstForename = '0' 
    OR AlternateName.upperFirstForename like :firstForename 
  ) 
  AND 
  (
    :searchBySurname = '0' 
    OR AlternateName.upperSurname like :surname 
  ) 
  AND ConcernRole.concernRoleID = Person.concernRoleID 
  AND AlternateName.concernRoleID = Person.concernRoleID 
  AND ConcernRoleAddress.concernRoleID = ConcernRole.concernRoleID 
  AND Address.addressID = ConcernRoleAddress.addressID 
  AND 
  (
    :searchByAddressData = '0' 
    OR Address.addressData like :addressData 
  ) 
  AND 
  (
    :searchByDateOfBirth = '0' 
    OR Person.dateOfBirth = :dateOfBirth 
  )