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
|