Operation Details
Description: Method to return root organization unit for specified organization structure and status.
Sterotype: ns
SQL
SELECT
  OrganisationUnit.organisationUnitID,
  OrganisationUnit.name
INTO
  :organisationUnitID,
  :name 
FROM
  OrganisationUnit,
  OrgUnitParentLink 
WHERE OrgUnitParentLink.organisationStructureID = :organisationStructureID 
  AND OrgUnitParentLink.parentOrganisationUnitID IS NULL 
  AND OrganisationUnit.organisationUnitID = OrgUnitParentLink.organisationUnitID 
  AND OrgUnitParentLink.recordStatus = :recordStatus