Operation Details
Description: This return organization unit details based on name and business type. Search is performed based on partial match of the name criteria.
Sterotype: nsmulti
SQL
SELECT
  OrganisationUnit.organisationUnitID,
  OrganisationUnit.name,
  OrganisationUnit.statusCode,
  OrganisationUnit.businessTypeCode,
  OrganisationStructure.name,
  OrganisationStructure.organisationStructureID
INTO
  :organisationUnitID,
  :name,
  :statusCode,
  :businessTypeCode,
  :organisationStructureName,
  :organisationStrucureID 
FROM
  OrganisationUnit,
  OrgUnitParentLink,
  OrganisationStructure 
WHERE 
  (
    OrgUnitParentLink.organisationStructureID = :organisationStructureID 
    OR 
    (
      :organisationStructureIDIsNull <> '0' 
    ) 
  ) 
  AND OrgUnitParentLink.organisationUnitID = OrganisationUnit.organisationUnitID 
  AND 
  (
    OrganisationUnit.businessTypeCode = :businessTypeCode 
    OR :businessTypeCode IS NULL 
  ) 
  AND 
  (
    upper(OrganisationUnit.name) like :name 
    OR :name IS NULL 
  ) 
  AND 
  (
    OrganisationUnit.recordStatus = :recordStatus 
    OR :recordStatus IS NULL 
  ) 
  AND OrganisationStructure.organisationStructureID = OrgUnitParentLink.organisationStructureID