Operation Details
Description: Search for an existing employment
Sterotype: nsmulti
SQL
SELECT
  employmentID,
  employerConcernRoleID,
  occupationType,
  status,
  fromDate,
  toDate
INTO
  :employmentID,
  :employerConcernRoleID,
  :occupationType,
  :status,
  :fromDate,
  :toDate 
FROM
  Employment 
WHERE concernRoleID = :concernRoleID 
  AND employerConcernRoleID = :employerConcernRoleID 
  AND status = :status 
  AND 
  (
    
    (
      toDate >= :fromDate 
      OR toDate IS NULL 
    ) 
    AND 
    (
      fromDate <= :toDate 
      OR :toDate IS NULL 
    ) 
  )