Operation Details
Description: Reads name, leading position indicator, supervisor position name, job name, organization unit name and record status details for position.
Sterotype: ns
SQL
SELECT
  P.name,
  P.leadPositionInd,
  RP.name,
  Job.name,
  OrgUnitPositionLink.organisationUnitID,
  OrganisationUnit.name,
  P.recordStatus
INTO
  :positionName,
  :leadPositionInd,
  :reportsToName,
  :jobName,
  :organisationUnitID,
  :organisationUnitName,
  :recordStatus 
FROM
  Position P 
  
  LEFT OUTER JOIN
  
  PositionReportingLink 
  ON (P.positionID = PositionReportingLink.positionID 
  AND PositionReportingLink.organisationStructureID = :organisationStructureID 
  AND PositionReportingLink.recordStatus = :recordStatus) 
  
  LEFT OUTER JOIN
  
  Position RP 
  ON RP.positionID = PositionReportingLink.reportsToID,
  OrgUnitPositionLink,
  OrganisationUnit,
  Job 
WHERE P.positionID = :positionID 
  AND OrgUnitPositionLink.positionID = P.positionID 
  AND OrgUnitPositionLink.organisationStructureID = :organisationStructureID 
  AND OrganisationUnit.organisationUnitID = OrgUnitPositionLink.organisationUnitID 
  AND Job.jobID = P.jobID