DBA Data[Home] [Help]

APPS.PA_HR_UPDATE_PA_ENTITIES SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 20

       pa_debug.write('PA_HR_UPDATE_PA_ENTITIES', 'log: ' || p_log_msg, 3);
Line: 31

PROCEDURE update_project_entities    ( p_calling_mode              in  varchar2,
                                       p_table_name                in  varchar2,
                                       p_person_id                 in  number DEFAULT NULL,
                                       p_start_date_old            in  date DEFAULT NULL,
                                       p_start_date_new            in  date DEFAULT NULL,
                                       p_end_date_old              in  date DEFAULT NULL,
                                       p_end_date_new              in  date DEFAULT NULL,
                                       p_org_id_old                in  number DEFAULT NULL,
                                       p_org_id_new                in  number DEFAULT NULL,
                                       p_job_id_old                in  number DEFAULT NULL,
                                       p_job_id_new                in  number DEFAULT NULL,
                                       p_from_job_group_id         in  number DEFAULT NULL,
                                       p_to_job_group_id           in  number DEFAULT NULL,
                                       p_job_level_old             in  number DEFAULT NULL,
                                       p_job_level_new             in  number DEFAULT NULL,
                                       p_supervisor_old            in  number DEFAULT NULL,
                                       p_supervisor_new            in  number DEFAULT NULL,
                                       p_primary_flag_old          in  varchar2 DEFAULT NULL,
                                       p_primary_flag_new          in  varchar2 DEFAULT NULL,
                                       p_org_info1_old             in  varchar2 DEFAULT NULL,
                                       p_org_info1_new             in  varchar2 DEFAULT NULL,
                                       p_jei_information2_old      in  varchar2 DEFAULT NULL,
                                       p_jei_information2_new      in  varchar2 DEFAULT NULL,
                                       p_jei_information3_old      in  varchar2 DEFAULT NULL,
                                       p_jei_information3_new      in  varchar2 DEFAULT NULL,
                                       p_jei_information4_old      in  varchar2 DEFAULT NULL,
                                       p_jei_information4_new      in  varchar2 DEFAULT NULL,
                                       p_jei_information6_old      in  varchar2 DEFAULT NULL,
                                       p_jei_information6_new      in  varchar2 DEFAULT NULL,
                                       p_grade_id_old              in  number DEFAULT NULL,
                                       p_grade_id_new              in  number DEFAULT NULL,
                                       p_full_name_old             in  varchar2 DEFAULT NULL,
                                       p_full_name_new             in  varchar2 DEFAULT NULL,
                                       p_country_old               in  varchar2 DEFAULT NULL,
                                       p_country_new               in  varchar2 DEFAULT NULL,
                                       p_city_old                  in  varchar2 DEFAULT NULL,
                                       p_city_new                  in  varchar2 DEFAULT NULL,
                                       p_region2_old               in  varchar2 DEFAULT NULL,
                                       p_region2_new               in  varchar2 DEFAULT NULL,
                                       p_org_struct_element_id     in  number DEFAULT NULL,
                                       p_organization_id_parent    in  number DEFAULT NULL,
                                       p_organization_id_child     in  number DEFAULT NULL,
                                       p_org_structure_version_id  in  number DEFAULT NULL,
                                       p_inactive_date_old         in  date DEFAULT NULL,
                                       p_inactive_date_new         in  date DEFAULT NULL,
                                       p_from_job_id_old           in  number DEFAULT NULL,
                                       p_from_job_id_new           in  number DEFAULT NULL,
                                       p_to_job_id_old             in  number DEFAULT NULL,
                                       p_to_job_id_new             in  number DEFAULT NULL,
                                       p_org_info_context          in  varchar2 DEFAULT NULL,
                                       x_return_status             out NOCOPY varchar2, --File.Sql.39 bug 4440895
                                       x_error_message_code        out NOCOPY varchar2) --File.Sql.39 bug 4440895
               is
--
--
--

ItemType        varchar2(30) := 'PAXWFHRU';  -- Identifies the workflow that will be executed.
Line: 142

          IF ( p_calling_mode='INSERT' AND (p_jei_information3_new='N' OR p_jei_information3_new IS NULL)) THEN
             return;
Line: 151

        SELECT pa_workflow_itemkey_s.nextval
          INTO itemkey
          FROM dual;
Line: 477

           PA_WORKFLOW_UTILS.Insert_WF_Processes
                (p_wf_type_code        => 'HR_CHANGE_MGMT'
                ,p_item_type           => itemtype
                ,p_item_key            => itemkey
                ,p_entity_key1         => to_char(p_person_id)
                ,p_entity_key2         => to_char(p_person_id)
                ,p_description         => NULL
                ,p_err_code            => l_err_code
                ,p_err_stage           => l_err_stage
                ,p_err_stack           => l_err_stack
                );
Line: 500

END update_project_entities;
Line: 557

                                              avalue                => pa_hr_update_api.get_org_name(l_organization_id_child));
Line: 562

                                              avalue                => pa_hr_update_api.get_org_name(l_organization_id_parent));
Line: 599

            wf_core.context('pa_hr_update_pa_objects',
                            'start_date_change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 611

            wf_core.context('pa_hr_update_pa_objects',
                            'start_date_change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 717

                                     avalue                => pa_hr_update_api.get_job_name(l_job_id));
Line: 725

       pa_hr_update_api.per_job_extra_billability
                      (p_calling_mode           =>l_calling_mode
                      ,P_job_id                 =>l_job_id
                      ,P_billable_flag_new      =>l_jei_information2_new
                      ,P_billable_flag_old      =>l_jei_information2_old
                      ,P_utilize_flag_new       =>l_jei_information3_new
                      ,P_utilize_flag_old       =>l_jei_information3_old
                      ,P_job_level_new          =>l_jei_information4_new
                      ,P_job_level_old          =>l_jei_information4_old
                      ,p_schedulable_flag_new   =>l_jei_information6_new
                      ,p_schedulable_flag_old   =>l_jei_information6_old
                      ,x_return_status          =>l_return_status
                      ,x_msg_data               =>l_msg_data
                      ,x_msg_count              =>l_msg_count );
Line: 782

            wf_core.context('pa_hr_update_pa_objects',
                            'start_date_change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 798

            wf_core.context('pa_hr_update_pa_objects',
                            'start_date_change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 911

        PA_HR_UPDATE_API.update_name ( p_person_id          => l_person_id
                                      ,p_old_name           => l_full_name_old
                                      ,p_new_name           => l_full_name_new
                                      ,x_return_status      => l_return_status
                                      ,x_msg_count          => l_msg_count
                                      ,x_msg_data           => l_msg_data);
Line: 955

            wf_core.context('pa_hr_update_pa_entities',
                            'Full_Name_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 972

            wf_core.context('pa_hr_update_pa_entities',
                            'Full_Name_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 991

            wf_core.context('pa_hr_update_pa_entities',
                            'Full_Name_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1081

                                        avalue                => pa_hr_update_api.get_org_name(l_org_id));
Line: 1088

              pa_hr_update_api.default_ou_change
                                     ( p_calling_mode          => l_calling_mode,
                                       p_organization_id       => l_org_id,
                                       p_default_ou_new        => l_org_info1_new,
                                       p_default_ou_old        => l_org_info1_old,
                                       x_return_status         => l_return_status,
                                       x_msg_count             => l_msg_count,
                                       x_msg_data              => l_msg_data
                                      ) ;
Line: 1100

              pa_hr_update_api.proj_res_job_group_change
                                     ( p_calling_mode          => l_calling_mode,
                                       p_organization_id       => l_org_id,
                                       p_proj_job_group_new    => l_org_info1_new,
                                       p_proj_job_group_old    => l_org_info1_old,
                                       x_return_status         => l_return_status,
                                       x_msg_count             => l_msg_count,
                                       x_msg_data              => l_msg_data
                                      ) ;
Line: 1293

                                              avalue                => pa_hr_update_api.get_job_name(l_job_id_new));
Line: 1299

                                              avalue                => pa_hr_update_api.get_grade_name(l_grade_id_new));
Line: 1304

        PA_HR_UPDATE_API.update_job_levels( P_calling_mode              => l_calling_mode
                                           ,P_per_valid_grade_job_id    => l_job_id_New
                                           ,P_per_valid_grade_id_old    => l_grade_id_old
                                           ,P_per_valid_grade_id_new    => l_grade_id_New
                                           ,x_return_status             => l_return_status
                                           ,x_msg_count                 => l_msg_count
                                           ,x_msg_data                  => l_msg_data);
Line: 1350

            wf_core.context('pa_hr_update_pa_entities',
                            'Valid_Grade_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1367

            wf_core.context('pa_hr_update_pa_entities',
                            'Valid_Grade_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1385

            wf_core.context('pa_hr_update_pa_entities',
                            'Valid_Grade_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1471

                                              avalue                => pa_hr_update_api.get_grade_name(l_grade_id));
Line: 1476

        PA_HR_UPDATE_API.update_job_levels( P_calling_mode               => l_calling_mode
                                           ,P_per_grades_grade_id        => l_grade_id
                                           ,P_per_grades_sequence_old    => l_job_level_old
                                           ,P_per_grades_sequence_new    => l_job_level_new
                                           ,x_return_status              => l_return_status
                                           ,x_msg_count                  => l_msg_count
                                           ,x_msg_data                   => l_msg_data);
Line: 1520

            wf_core.context('pa_hr_update_pa_entities',
                            'Job_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1539

            wf_core.context('pa_hr_update_pa_entities',
                            'Job_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1559

            wf_core.context('pa_hr_update_pa_entities',
                            'Job_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1711

        pa_hr_update_api.address_change(  p_calling_mode           => l_calling_mode
                                        , p_person_id              => l_person_id
                                        , p_country_old            => l_country_old
                                        , p_country_new            => l_country_new
                                        , p_city_old               => l_city_old
                                        , p_city_new               => l_city_new
                                        , p_region2_old            => l_region2_old
                                        , p_region2_new            => l_region2_new
                                        , p_date_from_old          => l_date_from_old
                                        , p_date_from_new          => l_date_from_new
                                        , p_date_to_old            => l_date_to_old
                                        , p_date_to_new            => l_date_to_new
                                        , p_addr_prim_flag_old     => l_addr_prim_flag_old
                                        , p_addr_prim_flag_new     => l_addr_prim_flag_new
                                        , x_return_status          => l_return_status
                                        , x_msg_count              => l_msg_count
                                        , x_msg_data               => l_msg_data);
Line: 1768

            wf_core.context('pa_hr_update_pa_entities',
                            'Address_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1788

            wf_core.context('pa_hr_update_pa_entities',
                            'Address_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1809

            wf_core.context('pa_hr_update_pa_entities',
                            'Address_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 1901

                                              avalue        => pa_hr_update_api.get_org_name(l_org_id));
Line: 1904

        IF l_calling_mode = 'UPDATE' THEN

        --dbms_output.put_line('Calling Mode is Update');
Line: 1915

           if(pa_hr_update_api.belongs_ExpOrg(l_org_id) = 'N') then
                 -- dbms_output.put_line('Making resources inactive');
Line: 1918

                  PA_HR_UPDATE_API.make_resource_inactive( p_calling_mode       => l_calling_mode
                                                          ,P_Organization_id    => l_org_id
                                                          ,P_Default_OU         => l_org_info1_new
                                                          ,P_inactive_date      => l_inactive_date_new
                                                          ,x_return_status      => l_return_status
                                                          ,x_msg_count          => l_msg_count
                                                          ,x_msg_data           => l_msg_data);
Line: 1927

                 PA_HR_UPDATE_API.pull_resources( P_Organization_id    => l_org_id
                                                 ,x_return_status      => l_return_status
                                                 ,x_msg_count          => l_msg_count
                                                 ,x_msg_data           => l_msg_data);
Line: 1933

        ELSIF l_calling_mode = 'INSERT' THEN
                --dbms_output.put_line('Calling mode is Insert');
Line: 1938

           pa_hr_update_api.default_ou_change( p_calling_mode          => l_calling_mode,
                                               p_organization_id       => l_org_id,
                                               p_default_ou_new        => l_org_info1_new,
                                               p_default_ou_old        => l_org_info1_old,
                                               x_return_status         => l_return_status,
                                               x_msg_count             => l_msg_count,
                                               x_msg_data              => l_msg_data
                                              ) ;
Line: 1985

            wf_core.context('pa_hr_update_pa_entities',
                            'Address_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 2005

            wf_core.context('pa_hr_update_pa_entities',
                            'Project_Organization_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 2028

            wf_core.context('pa_hr_update_pa_entities',
                            'Project_Organization_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 2128

                                              avalue                => pa_hr_update_api.get_job_name(l_from_job_id_new));
Line: 2133

                                            avalue                => pa_hr_update_api.get_job_name(l_to_job_id_new));
Line: 2137

        PA_HR_UPDATE_API.update_job_levels( P_calling_mode       => l_calling_mode
                                           ,P_from_job_id_old    => l_from_job_id_old
                                           ,P_from_job_id_new    => l_from_job_id_new
                                           ,P_to_job_id_old      => l_to_job_id_old
                                           ,P_to_job_id_new      => l_to_job_id_new
                                           ,P_from_job_group_id  => l_from_job_group_id
                                           ,P_to_job_group_id    => l_to_job_group_id
                                           ,x_return_status      => l_return_status
                                           ,x_msg_count          => l_msg_count
                                           ,x_msg_data           => l_msg_data);
Line: 2185

            wf_core.context('pa_hr_update_pa_entities',
                            'Address_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 2204

            wf_core.context('pa_hr_update_pa_entities',
                            'Address_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 2225

            wf_core.context('pa_hr_update_pa_entities',
                            'Address_Change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 2372

	if l_calling_mode = 'DELETE'  then
		pa_hr_update_api.Delete_PA_Resource_Denorm (
                             p_person_id          => l_person_id
                            ,p_old_start_date     => l_start_date_old
                            ,p_old_end_date       => l_end_date_old
                            ,x_return_status      => l_return_status
                            ,x_msg_count          => l_msg_count
                            ,x_msg_data           => l_msg_data);
Line: 2425

       elsif  l_calling_mode = 'INSERT'  then

            if ( l_primary_flag_new = 'Y' and pa_hr_update_api.belongs_ExpOrg(l_org_id_new) = 'Y') then
              -- Added new if condition for Bug 7423251
              IF (pa_hr_update_api.check_job_utilization (p_job_id     => l_job_id_new
                                                         ,p_person_id  => null
                                                         ,p_date       => null)) = 'Y'  then
                -- call the work flow to update pa objects
                SAVEPOINT l_assignment_change;
Line: 2479

       elsif l_calling_mode = 'UPDATE' then
            SAVEPOINT l_assignment_change;
Line: 2484

                       and pa_hr_update_api.belongs_ExpOrg(l_org_id_new) = 'Y') then
                 --dbms_output.put_line('Calling ind pull 1');
Line: 2536

                                  and pa_hr_update_api.belongs_ExpOrg(l_org_id_new) = 'N') then

                  /*If the assignments organization does not belong to expenditure hierarchy
                    then the corresponding assignment in pa_resources_denorm must be
                    end dated
                  */
                  pa_hr_update_api.Update_EndDate(
                          p_person_id => l_person_id,
                          p_old_start_date => l_start_date_old,
                          p_new_start_date => l_start_date_new,
                          p_old_end_date => l_end_date_old,
                          p_new_end_date => sysdate,
                          x_return_status => l_return_status,
                          x_msg_data => l_msg_data,
                          x_msg_count => l_msg_count);
Line: 2556

                  pa_hr_update_api.Update_PrimaryFlag (
                     p_person_id          => l_person_id
                    ,p_old_start_date     => l_start_date_old
                    ,p_new_start_date     => l_start_date_new
                    ,p_old_end_date       => l_end_date_old
                    ,p_new_end_date       => l_end_date_new
                    ,x_return_status      => l_return_status
                    ,x_msg_count          => l_msg_count
                    ,x_msg_data           => l_msg_data);
Line: 2594

            SELECT 'Y'
            INTO   l_res_asgn_exists
            FROM   dual
            WHERE EXISTS (SELECT 'Y'
                          FROM   pa_resources_denorm
                          WHERE  person_id                     = l_person_id
                          AND    resource_effective_start_date =
                                                             l_start_date_new);
Line: 2609

               pa_hr_update_api.belongs_ExpOrg(l_org_id_new) = 'Y') THEN commented and changed as below for bug 5665503 */

	   if ( l_res_asgn_exists = 'N' OR (trunc( l_start_date_old) <> trunc( l_start_date_new)) )
	      AND ( pa_hr_update_api.belongs_ExpOrg(l_org_id_new) = 'Y')
	       THEN

           --dbms_output.put_line('Calling ind pull 2 as record does not exist or start date is changed');
Line: 2666

                        pa_hr_update_api.Update_EndDate (
                             p_person_id          => l_person_id
                            ,p_old_start_date     => l_start_date_old
                            ,p_new_start_date     => l_start_date_new
                            ,p_old_end_date       => l_end_date_old
                            ,p_new_end_date       => l_end_date_new
                            ,x_return_status      => l_return_status
                            ,x_msg_count          => l_msg_count
                            ,x_msg_data           => l_msg_data);
Line: 2692

                        pa_hr_update_api.Update_Org (
                             p_person_id          => l_person_id
                            ,p_old_org_id         => l_org_id_old
                            ,p_new_org_id         => l_org_id_new
                            ,p_old_start_date     => l_start_date_old
                            ,p_new_start_date     => l_start_date_new
                            ,p_old_end_date       => l_end_date_old
                            ,p_new_end_date       => l_end_date_new
                            ,x_return_status      => l_return_status
                            ,x_msg_count          => l_msg_count
                            ,x_msg_data           => l_msg_data);
Line: 2721

                        pa_hr_update_api.Update_Job (
                             p_person_id          => l_person_id
                            ,p_old_job            => l_job_id_old
                            ,p_new_job            => l_job_id_new
                            ,p_new_start_date     => l_start_date_new
                            ,p_new_end_date       => l_end_date_new
                            ,x_return_status      => l_return_status
                            ,x_msg_count          => l_msg_count
                            ,x_msg_data           => l_msg_data);
Line: 2748

                        pa_hr_update_api.Update_Supervisor (
                             p_person_id          => l_person_id
                            ,p_old_supervisor     => l_supervisor_old
                            ,p_new_supervisor     => l_supervisor_new
                            ,p_new_start_date     => l_start_date_new
                            ,p_new_end_date       => l_end_date_new
                            ,x_return_status      => l_return_status
                            ,x_msg_count          => l_msg_count
                            ,x_msg_data           => l_msg_data);
Line: 2772

       end if; --end update
Line: 2811

       wf_core.context     ('pa_hr_update_pa_objects',
                            'start_date_change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 2842

       wf_core.context('pa_hr_update_pa_objects',
                            'start_date_change',
                             itemtype,
                             itemkey,
                             to_char(actid),
                             funcmode);
Line: 3019

   SELECT pa_workflow_itemkey_s.nextval
   INTO l_item_key
   FROM dual;
Line: 3087

           PA_WORKFLOW_UTILS.Insert_WF_Processes
                (p_wf_type_code        => 'HR_CHANGE_MGMT'
                ,p_item_type           => l_item_type
                ,p_item_key            => l_item_key
                ,p_entity_key1         => to_char(p_person_id)
                ,p_entity_key2         => to_char(p_person_id)
                ,p_description         => NULL
                ,p_err_code            => l_err_code
                ,p_err_stage           => l_err_stage
                ,p_err_stack           => l_err_stack
                );
Line: 3116

     FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_HR_UPDATE_PA_ENTITIES',
                              p_procedure_name   => 'create_fte_sync_wf');
Line: 3193

  SELECT max(resource_effective_end_date)
  INTO l_resource_effective_end_date
  FROM pa_resources_denorm
  WHERE person_id = l_person_id;
Line: 3198

  log_message('before calling PA_HR_UPDATE_API.withdraw_cand_nominations, l_resource_effective_end_date: '||l_resource_effective_end_date);
Line: 3199

  PA_HR_UPDATE_API.withdraw_cand_nominations
                 ( p_person_id        => l_person_id,
                   p_effective_date   => l_resource_effective_end_date,
                   x_return_status    => l_return_status,
                   x_msg_data         => l_msg_data,
                   x_msg_count        => l_msg_count);
Line: 3205

  log_message('after calling PA_HR_UPDATE_API.withdraw_cand_nominations, l_return_status: '||l_return_status);
Line: 3252

  wf_core.context('pa_hr_update_pa_entities',
                  'Start_fte_sync_wf',
		  itemtype,
                  itemkey,
                  to_char(actid),
                  funcmode);