[Home] [Help]
779:
780: -- -----------------------------------------------------
781: -- procedure UPDATE_PJI_ORG_HRCHY
782: --
783: -- This procedure incrementally synchronizes HRI_ORG_HRCHY_SUMMARY with
784: -- PJI_ORG_DENORM. This is required because incremental updates on
785: -- HRI_ORG_HRCHY_SUMMARY are performed by deleting the entire table and
786: -- repopulating it. This would cause slow mview refreshes.
787: --
781: -- procedure UPDATE_PJI_ORG_HRCHY
782: --
783: -- This procedure incrementally synchronizes HRI_ORG_HRCHY_SUMMARY with
784: -- PJI_ORG_DENORM. This is required because incremental updates on
785: -- HRI_ORG_HRCHY_SUMMARY are performed by deleting the entire table and
786: -- repopulating it. This would cause slow mview refreshes.
787: --
788: -- -----------------------------------------------------
789: procedure UPDATE_PJI_ORG_HRCHY is
802: PJI_ROWID,
803: CHANGE_FLAG
804: )
805: select /*+ ordered full(pji) use_hash(pji)
806: index(hri, HRI_ORG_HRCHY_SUMMARY_U1) */
807: hri.ROWID,
808: pji.ROWID,
809: case when hri.ORGANIZATION_LEVEL <> pji.ORGANIZATION_LEVEL or
810: hri.SUB_ORGANIZATION_LEVEL <> pji.SUB_ORGANIZATION_LEVEL
811: then 'Y'
812: else 'N'
813: end
814: from
815: HRI_ORG_HRCHY_SUMMARY hri,
816: PJI_ORG_DENORM pji
817: where
818: hri.ORG_STRUCTURE_VERSION_ID = l_org_structure_version_id and
819: hri.ORGANIZATION_ID = pji.ORGANIZATION_ID (+) and
845: hri.ORGANIZATION_LEVEL,
846: hri.SUB_ORGANIZATION_LEVEL
847: from
848: PJI_ROWID_ORG_DENORM org_r,
849: HRI_ORG_HRCHY_SUMMARY hri
850: where
851: org_r.PJI_ROWID = denorm.ROWID and
852: hri.ROWID = org_r.HRI_ROWID
853: )
877: hri.ORGANIZATION_LEVEL,
878: hri.SUB_ORGANIZATION_ID,
879: hri.SUB_ORGANIZATION_LEVEL
880: from
881: HRI_ORG_HRCHY_SUMMARY hri
882: where
883: hri.ROWID in
884: (
885: select /*+ index(org_r, PJI_ROWID_ORG_DENORM_N1) */