DBA Data[Home] [Help]

APPS.GHR_CORR_CANC_SF52 SQL Statements

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

Line: 20

	select
		*
	from ghr_pa_requests
	where pa_request_id = c_pa_request_id;
Line: 28

Procedure	delete_element_entry(
				p_hist_rec 		in 	ghr_pa_history%rowtype,
				p_del_mode		in	varchar2 default hr_api.g_delete_next_change,
   			p_cannot_cancel	 out nocopy Boolean) ;
Line: 33

Procedure	delete_eleentval( p_hist_rec in ghr_pa_history%rowtype) ;
Line: 34

Procedure	delete_peop_row(
				p_person_id		in	varchar2,
  				p_dt_mode		in	varchar2,
  				p_date_effective	in	date) ;
Line: 38

Procedure	delete_asgn_row(
				p_assignment_id	in	varchar2,
  				p_dt_mode		in	varchar2,
  				p_date_effective	in	date) ;
Line: 42

Procedure	delete_peopei_row( p_person_extra_info_id	in	varchar2) ;
Line: 43

Procedure	delete_asgnei_row( p_assignment_extra_info_id	in	varchar2) ;
Line: 44

Procedure	delete_posnei_row( p_position_extra_info_id	in	varchar2) ;
Line: 45

Procedure	delete_address_row(p_address_id	in	varchar2) ;
Line: 46

Procedure	delete_person_analyses_row ( p_person_analysis_id	in	number);
Line: 48

Procedure	delete_appl_row(
				p_table_name	in	varchar2,
  				p_table_pk_id	in	varchar2,
  				p_dt_mode		in	varchar2,
  				p_date_effective	in	date) ;
Line: 53

Procedure	delete_hist_row (
				p_row_id 			in	rowid);
Line: 55

Procedure	delete_hist_row (
				p_pa_history_id 	in	ghr_pa_history.pa_history_id%type);
Line: 72

				p_can_delete	 out nocopy 	boolean,
				p_last_row		 out nocopy 	boolean,
				p_cannot_cancel	 out nocopy 	boolean) ;
Line: 97

Procedure delete_other_pay_entries(p_hist_rec in ghr_pa_history%rowtype,
                                    p_element_name in varchar2);
Line: 151

	select
		rowid row_id, table_name,pa_history_id,information5
                ,information9, information10
	from ghr_pa_history
	where pa_request_id = c_pa_request_id
	and  nature_of_action_id = c_noa_id
	for update of person_id
        order by pa_history_id desc; -- Bug# 1316321
Line: 164

	select 	pa_history_id
	from		ghr_pa_history
	where		table_name		= c_table_name
		and	information1	= c_pk_id
		and 	pa_history_id	> c_pa_history_id;
Line: 173

        select  *
        from ghr_pa_history
        where pa_request_id = c_pa_request_id
          and table_name    = c_table_name;
Line: 316

	ghr_sf52_pre_update.populate_record_groups (
		 	p_pa_request_rec                => l_sf52_data,
			p_generic_ei_rec                => l_agency_ei_data,
			p_imm_asg_sf52                  => l_imm_asg_sf52,
			p_imm_asg_non_sf52              => l_imm_asg_non_sf52,
			p_imm_asg_nte_dates             => l_imm_asg_nte_dates,
			p_imm_asg_detail_info	        => l_imm_asg_detail_info, --Bug# 8653508
			p_imm_per_sf52                  => l_imm_per_sf52,
			p_imm_per_group1                => l_imm_per_group1,
			p_imm_per_group2                => l_imm_per_group2,
			p_imm_per_scd_info              => l_imm_per_scd_info,
			p_imm_per_retained_grade        => l_imm_per_retained_grade,
			p_imm_per_probations            => l_imm_per_probations,
			p_imm_per_sep_retire            => l_imm_per_sep_retire,
			p_imm_per_security              => l_imm_per_security,
			--Bug#4486823 RRR Changes
            p_imm_per_service_oblig         => l_imm_per_service_oblig,
			p_imm_per_conversions           => l_imm_per_conversions,
			-- 4352589 BEN_EIT Changes
			p_imm_per_benefit_info          => l_imm_per_benefit_info,
			p_imm_per_uniformed_services    => l_imm_per_uniformed_services,
			p_imm_pos_oblig                 => l_imm_pos_oblig,
			p_imm_pos_grp2                  => l_imm_pos_grp2,
			p_imm_pos_grp1                  => l_imm_pos_grp1,
			p_imm_pos_valid_grade           => l_imm_pos_valid_grade,
			p_imm_pos_car_prog              => l_imm_pos_car_prog,
			p_imm_loc_info                  => l_imm_loc_info,
			p_imm_wgi                       => l_imm_wgi,
			p_imm_gov_awards                => l_imm_gov_awards,
			p_imm_recruitment_bonus         => l_imm_recruitment_bonus,
			p_imm_relocation_bonus          => l_imm_relocation_bonus,
			p_imm_student_loan_repay        => l_imm_student_loan_repay,
			p_imm_per_race_ethnic_info 		=> l_imm_per_race_ethnic_info, -- Bug 4724337 Race or National Origin changes
			--Pradeep
			p_imm_mddds_special_pay         => l_imm_mddds_special_pay,
			p_imm_premium_pay_ind           => l_imm_premium_pay_ind,

			p_imm_perf_appraisal            => l_imm_perf_appraisal,
			p_imm_conduct_performance       => l_imm_conduct_performance,
			p_imm_payroll_type              => l_imm_payroll_type,
			p_imm_extra_info_rec	        => l_imm_extra_info_rec,
			p_imm_sf52_from_data            => l_imm_sf52_from_data,
			p_imm_personal_info	        	=> l_imm_personal_info,
			p_imm_generic_extra_info_rec    => l_imm_generic_extra_info_rec,
			p_imm_agency_sf52               => l_imm_agency_sf52,
			p_agency_code                   => l_agency_code,
			p_imm_par_term_retained_grade   => l_imm_par_term_retained_grade,
			p_imm_entitlement               => l_imm_entitlement,
                        -- Bug#2759379 Added FEGLI Record
            p_imm_fegli                     => l_imm_fegli,
			p_imm_foreign_lang_prof_pay     => l_imm_foreign_lang_prof_pay,
			-- Bug#3385386 Added FTA Record
			p_imm_fta                       => l_imm_fta,
			p_imm_edp_pay                   => l_imm_edp_pay,
			p_imm_hazard_pay                => l_imm_hazard_pay,
			p_imm_health_benefits           => l_imm_health_benefits,
			p_imm_danger_pay                => l_imm_danger_pay,
			p_imm_imminent_danger_pay       => l_imm_imminent_danger_pay,
			p_imm_living_quarters_allow     => l_imm_living_quarters_allow,
			p_imm_post_diff_amt             => l_imm_post_diff_amt,
			p_imm_post_diff_percent         => l_imm_post_diff_percent,
			p_imm_sep_maintenance_allow     => l_imm_sep_maintenance_allow,
			p_imm_supplemental_post_allow   => l_imm_supplemental_post_allow,
			p_imm_temp_lodge_allow          => l_imm_temp_lodge_allow,
			p_imm_premium_pay               => l_imm_premium_pay,
			p_imm_retirement_annuity        => l_imm_retirement_annuity,
			p_imm_severance_pay             => l_imm_severance_pay,
			p_imm_thrift_saving_plan        => l_imm_thrift_saving_plan,
			p_imm_retention_allow_review    => l_imm_retention_allow_review,
			p_imm_health_ben_pre_tax        => l_imm_health_ben_pre_tax,
			--Bug# 6312144 RPA EIT Benefits
			p_imm_ipa_benefits_cont         => l_imm_ipa_benefits_cont,
                        p_imm_retirement_info           => l_imm_retirement_info,
			--BUG # 13571004 added TSP Roth
                        p_imm_tsp_roth                  => l_imm_roth_tsp
                         );
Line: 471

		-- Need to delete end dated position record only if it's MTO -- Sundar 2835138
		IF (UPPER(SUBSTR(p_sf52_data.request_number,1,3)) = 'MTO') THEN
		-- End 2835138
                SELECT name, object_version_number
                  INTO l_pos_name, l_object_version_number
                FROM hr_all_positions_f
                WHERE position_id = p_sf52_data.from_position_id
                  AND (p_sf52_data.effective_date  - 1) BETWEEN effective_start_date
                                                     AND effective_end_date;
Line: 480

                 hr_position_api.delete_position
                 (p_position_id                   => p_sf52_data.from_position_id,
                  p_object_version_number         => l_object_version_number,
                  p_effective_date                => p_sf52_data.effective_date - 1,
                  p_effective_start_date          => l_effective_start_date,
                  p_effective_end_date            => l_effective_end_date,
                  p_datetrack_mode                => 'DELETE_NEXT_CHANGE'
                  );
Line: 493

		UPDATE 	per_positions
		SET 		date_end = null
		WHERE	 	position_id = p_sf52_data.from_position_id;
Line: 501

		SELECT 	*
		INTO 	l_hist_rec
		FROM 	ghr_pa_history
		WHERE	pa_request_id 		= p_sf52_data.altered_pa_request_id
		AND	information5 		= 'GHR_US_PER_SEPARATE_RETIRE'
		AND	table_name			= ghr_history_api.g_peopei_table
		AND	nature_of_action_id 	= (select nature_of_action_id from ghr_nature_of_actions where
									code = '352');
Line: 523

			-- only delete application table if there are no following records.
			open c_follow_rec(	c_table_name	=>	l_hist_rec.table_name,
							c_pk_id		=>	l_hist_rec.information1,
							c_pa_history_id	=>	l_hist_rec.pa_history_id);
Line: 530

			delete_appl_row(
				p_table_name	=> ghr_history_api.g_peopei_table,
				p_table_pk_id	=> l_hist_rec.information1,
				p_dt_mode		=> null,
				p_date_effective	=> l_hist_rec.effective_date);
Line: 575

          delete_element_entry( p_hist_rec   => l_hist_sevpay,
                         p_del_mode          => hr_api.g_zap,
                         p_cannot_cancel     => l_cannot_cancel_sevpay);
Line: 585

           hr_utility.set_location('Delete rows.'|| l_proc,40);
Line: 586

           delete_hist_row ( l_hist_sevpay.pa_history_id);
Line: 587

           delete_eleentval( l_hist_sevpay);
Line: 594

	-- delete all history records for the termination that is being cancelled.
	-- if an address table record is encountered, then set application
	-- table to what it currently should be according to history.
	hr_utility.set_location( l_proc, 20);
Line: 610

			SELECT 	*
			INTO 		l_hist_rec
			FROM 		ghr_pa_history
			WHERE		pa_history_id	= l_hist.pa_history_id;
Line: 629

				-- only delete application table if there are no following records.
				open c_follow_rec(	c_table_name	=>	l_hist_rec.table_name,
								c_pk_id		=>	l_hist_rec.information1,
								c_pa_history_id	=>	l_hist_rec.pa_history_id);
Line: 637

					delete_appl_row(
						p_table_name	=> l_hist.table_name,
						p_table_pk_id	=> l_hist_rec.information1,
						p_dt_mode		=> null,
						p_date_effective	=> l_hist_rec.effective_date);
Line: 655

				delete_hist_row( l_hist.row_id);
Line: 668

                hr_utility.set_location('Non 352 and  delete_hist_row '||l_proc,27);
Line: 673

	-- delete all history records for the termination that is being cancelled.
	-- if an address table record is encountered, then set application
	-- table to what it currently should be according to history.
	hr_utility.set_location( l_proc, 20);
Line: 681

          delete_hist_row( l_hist.row_id);
Line: 700

	ghr_agency_update.ghr_agency_upd(
			p_pa_request_rec			=> l_sf52_data,
			p_asg_sf52				=> l_imm_asg_sf52,
			p_asg_non_sf52			=> l_imm_asg_non_sf52,
			p_asg_nte_dates			=> l_imm_asg_nte_dates,
			p_per_sf52              	=> l_imm_per_sf52,
			p_per_group1            	=> l_imm_per_group1,
			p_per_group2            	=> l_imm_per_group2,
			p_per_scd_info          	=> l_imm_per_scd_info,
			p_per_retained_grade    	=> l_imm_per_retained_grade,
			p_per_probations			=> l_imm_per_probations,
			p_per_sep_Retire 	      	=> l_imm_per_sep_retire,
			p_per_security          	=> l_imm_per_security,
			p_per_conversions	      	=> l_imm_per_conversions,
			p_per_uniformed_services	=> l_imm_per_uniformed_services,
			p_pos_oblig                   => l_imm_pos_oblig,
			p_pos_grp2                    => l_imm_pos_grp2,
			p_pos_grp1                    => l_imm_pos_grp1,
			p_pos_valid_grade             => l_imm_pos_valid_grade,
			p_pos_car_prog                => l_imm_pos_car_prog,
			p_loc_info                    => l_imm_loc_info,
			p_wgi                         => l_imm_wgi,
			p_recruitment_bonus	      => l_imm_recruitment_bonus,
			p_relocation_bonus	      => l_imm_relocation_bonus ,
			p_sf52_from_data              => l_imm_sf52_from_data,
			p_personal_info	            => l_imm_personal_info,
			p_gov_awards_type             => l_imm_gov_awards,
			p_perf_appraisal_type         => l_imm_perf_appraisal,
			p_payroll_type                => l_imm_payroll_type,
			p_conduct_perf_type           => l_imm_conduct_performance,
			p_agency_code		      => l_agency_code,
			p_agency_sf52			=> l_imm_agency_sf52,
			p_entitlement                 => l_imm_entitlement,
			p_foreign_lang_prof_pay       => l_imm_foreign_lang_prof_pay,
			p_edp_pay                     => l_imm_edp_pay,
			p_hazard_pay                  => l_imm_hazard_pay,
			p_health_benefits             => l_imm_health_benefits,
			p_danger_pay                  => l_imm_danger_pay,
			p_imminent_danger_pay         => l_imm_imminent_danger_pay,
			p_living_quarters_allow       => l_imm_living_quarters_allow,
			p_post_diff_amt               => l_imm_post_diff_amt,
			p_post_diff_percent           => l_imm_post_diff_percent,
			p_sep_maintenance_allow       => l_imm_sep_maintenance_allow,
			p_supplemental_post_allow     => l_imm_supplemental_post_allow,
			p_temp_lodge_allow            => l_imm_temp_lodge_allow,
			p_premium_pay                 => l_imm_premium_pay,
			p_retirement_annuity          => l_imm_retirement_annuity,
			p_severance_pay               => l_imm_severance_pay,
			p_thrift_saving_plan          => l_imm_thrift_saving_plan,
			p_retention_allow_review      => l_imm_retention_allow_review,
			p_health_ben_pre_tax          => l_imm_health_ben_pre_tax,
			p_per_benefit_info            => l_imm_per_benefit_info,
			p_imm_retirement_info         => l_imm_retirement_info, --Bug# 7131104
			--Begin Bug# 10181661
			p_asg_detail_info	      => l_imm_asg_detail_info,
			p_ipa_detail_ben_cont_info    => l_imm_ipa_benefits_cont
			--End Bug# 10181661
			);
Line: 761

	ghr_sf52_post_update.post_sf52_cancel(
		p_pa_request_id		=> p_sf52_data.pa_request_id,
		p_effective_date	=> l_session_var.date_effective,
		p_object_version_number	=> p_sf52_data.object_version_number,
		p_from_position_id	=> p_sf52_data.from_position_id,
		p_to_position_id	=> p_sf52_data.to_position_id,
		p_agency_code		=> p_sf52_data.agency_code);
Line: 904

	select
		business_group_id
	from per_people_f
	where person_id = c_person_id and
		c_as_on_date between effective_start_date and effective_end_date;
Line: 911

	-- the rows for update.
	-- note that it selects all the records that were effective on or after the effective_date passed.
	-- also note that it orders by dml_operation, in order to ensure that updated rows are handled
	-- before inserted rows. This is necessary for the way we are handling the setting of extra info tables
	-- back to what they were prior to the appointment. If updated rows were handled before inserted rows, then
	-- the cascade_appl_table_data call may fail since it will be trying to fetch a pre-record for the
	-- updated row, but the pre-record has been deleted since we handled inserted rows first.
	cursor c_hist (c_person_id number,
			   c_eff_date  date) is
	select
		pah.rowid row_id,
		pah.*
	from ghr_pa_history pah
	where person_id = c_person_id and
		(effective_date > c_eff_date or
		 (effective_date = c_eff_date and pa_request_id is not NULL))
        and upper(pah.table_name) not in (upper(ghr_history_api.g_addres_table))
	for update of person_id
	order by dml_operation desc;
Line: 934

	select
		pah.rowid row_id,
		pah.*
	from ghr_pa_history pah
	where person_id = c_person_id and
		(effective_date > c_eff_date or
		 (effective_date = c_eff_date and pa_request_id is not NULL))
	and upper(pah.table_name) in (upper(ghr_history_api.g_addres_table))
	for update of person_id
	order by information1 desc,dml_operation desc;
Line: 947

	-- the rows for update.
	-- It returns all pa request rows that were effective on or after the effective date passed, as long as the
	-- pa request has been approved.
	cursor c_par ( c_person_id number,
			   c_eff_date  date) is
	select
		par.rowid,
		par.*
	from ghr_pa_requests par
	where person_id = c_person_id        and
		effective_date >= c_eff_date   and
            pa_notification_id is not null and
            approval_date is not null
	for update of person_id;
Line: 966

        SELECT 1
        FROM   PER_PERSON_ANALYSES
        WHERE  person_analysis_id = p_person_analysis_id;
Line: 976

	    select pah.rowid row_id
	    from   ghr_pa_history pah
	    where  table_name = p_table_name
	    and    information1 = p_information1
	    and    dml_operation = 'U';
Line: 1029

	ghr_sf52_pre_update.populate_record_groups (
		 	p_pa_request_rec                => l_sf52_data,
			p_generic_ei_rec                => l_agency_ei_data,
			p_imm_asg_sf52                  => l_imm_asg_sf52,
			p_imm_asg_non_sf52              => l_imm_asg_non_sf52,
			p_imm_asg_nte_dates             => l_imm_asg_nte_dates,
			p_imm_asg_detail_info	        => l_imm_asg_detail_info, --Bug# 8653508
			p_imm_per_sf52                  => l_imm_per_sf52,
			p_imm_per_group1                => l_imm_per_group1,
			p_imm_per_group2                => l_imm_per_group2,
			p_imm_per_scd_info              => l_imm_per_scd_info,
			p_imm_per_retained_grade        => l_imm_per_retained_grade,
			p_imm_per_probations            => l_imm_per_probations,
			p_imm_per_sep_retire            => l_imm_per_sep_retire,
			p_imm_per_security              => l_imm_per_security,
            --Bug#4486823 RRR Changes
            p_imm_per_service_oblig         => l_imm_per_service_oblig,
			p_imm_per_conversions           => l_imm_per_conversions,
			-- 4352589 BEN_EIT Changes
			p_imm_per_benefit_info          => l_imm_per_benefit_info,
			p_imm_per_uniformed_services    => l_imm_per_uniformed_services,
			p_imm_pos_oblig                 => l_imm_pos_oblig,
			p_imm_pos_grp2                  => l_imm_pos_grp2,
			p_imm_pos_grp1                  => l_imm_pos_grp1,
			p_imm_pos_valid_grade           => l_imm_pos_valid_grade,
			p_imm_pos_car_prog              => l_imm_pos_car_prog,
			p_imm_loc_info                  => l_imm_loc_info,
			p_imm_wgi                       => l_imm_wgi,
			p_imm_gov_awards                => l_imm_gov_awards,
			p_imm_recruitment_bonus         => l_imm_recruitment_bonus,
			p_imm_relocation_bonus          => l_imm_relocation_bonus,
			p_imm_student_loan_repay        => l_imm_student_loan_repay,
			p_imm_per_race_ethnic_info 		=> l_imm_per_race_ethnic_info, -- Bug 4724337 Race or National Origin changes
			--Pradeep
			p_imm_mddds_special_pay         => l_imm_mddds_special_pay,
			p_imm_premium_pay_ind           => l_imm_premium_pay_ind,

			p_imm_perf_appraisal            => l_imm_perf_appraisal,
			p_imm_conduct_performance       => l_imm_conduct_performance,
			p_imm_payroll_type              => l_imm_payroll_type,
			p_imm_extra_info_rec	        => l_imm_extra_info_rec,
			p_imm_sf52_from_data            => l_imm_sf52_from_data,
			p_imm_personal_info	        => l_imm_personal_info,
			p_imm_generic_extra_info_rec    => l_imm_generic_extra_info_rec,
			p_imm_agency_sf52               => l_imm_agency_sf52,
			p_agency_code                   => l_agency_code,
			p_imm_par_term_retained_grade   => l_imm_par_term_retained_grade,
			p_imm_entitlement               => l_imm_entitlement,
                        -- Bug#2759379 Added FEGLI Record
                        p_imm_fegli                     => l_imm_fegli,
			p_imm_foreign_lang_prof_pay     => l_imm_foreign_lang_prof_pay,
			-- Bug#3385386 Added FTA Record
			p_imm_fta                       => l_imm_fta,
			p_imm_edp_pay                   => l_imm_edp_pay,
			p_imm_hazard_pay                => l_imm_hazard_pay,
			p_imm_health_benefits           => l_imm_health_benefits,
			p_imm_danger_pay                => l_imm_danger_pay,
			p_imm_imminent_danger_pay       => l_imm_imminent_danger_pay,
			p_imm_living_quarters_allow     => l_imm_living_quarters_allow,
			p_imm_post_diff_amt             => l_imm_post_diff_amt,
			p_imm_post_diff_percent         => l_imm_post_diff_percent,
			p_imm_sep_maintenance_allow     => l_imm_sep_maintenance_allow,
			p_imm_supplemental_post_allow   => l_imm_supplemental_post_allow,
			p_imm_temp_lodge_allow          => l_imm_temp_lodge_allow,
			p_imm_premium_pay               => l_imm_premium_pay,
			p_imm_retirement_annuity        => l_imm_retirement_annuity,
			p_imm_severance_pay             => l_imm_severance_pay,
			p_imm_thrift_saving_plan        => l_imm_thrift_saving_plan,
			p_imm_retention_allow_review        => l_imm_retention_allow_review,
			p_imm_health_ben_pre_tax           => l_imm_health_ben_pre_tax,
			--Bug #6312144 RPA EIT Benefits
			p_imm_ipa_benefits_cont         => l_imm_ipa_benefits_cont,
                        p_imm_retirement_info           => l_imm_retirement_info,
			--BUG # 13571004 added TSP Roth
                        p_imm_tsp_roth                  => l_imm_roth_tsp
			);
Line: 1184

		delete_hist_row( l_hist.row_id);
Line: 1186

		-- Delete all extraInfo table records which were created by the SF52.
		if  upper(l_hist.table_name) in (upper(ghr_history_api.g_peopei_table),
							  upper(ghr_history_api.g_posnei_table),
							  upper(ghr_history_api.g_asgnei_table),
							  upper(ghr_history_api.g_addres_table),
							  upper(ghr_history_api.g_perana_table)) then
			hr_utility.set_location( 'table_name qualifies: ' || l_hist.table_name|| l_proc, 57);
Line: 1194

				hr_utility.set_location( 'delete appl row table_name: ' || l_hist.table_name|| l_proc, 51);
Line: 1195

				hr_utility.set_location( 'delete appl row information1: ' || l_hist.information1|| l_proc, 52);
Line: 1196

				hr_utility.set_location( 'delete appl row effective_date: ' || l_hist.effective_date|| l_proc, 53);
Line: 1197

				delete_appl_row(
					p_table_name	=> l_hist.table_name,
					p_table_pk_id	=> l_hist.information1,
					p_dt_mode	=> null,
					p_date_effective=> l_hist.effective_date);
Line: 1204

				-- is deleted from base table
                                FOR l_upd_hist in c_upd_hist(l_hist.table_name,
							     l_hist.information1)
				LOOP
				   delete_hist_row( l_upd_hist.row_id);
Line: 1255

		delete_hist_row( l_add_hist.row_id);
Line: 1257

		-- Delete all extraInfo table records which were created by the SF52.
			hr_utility.set_location( 'table_name qualifies: ' || l_add_hist.table_name|| l_proc, 57);
Line: 1260

				hr_utility.set_location( 'delete appl row table_name: ' || l_add_hist.table_name|| l_proc, 51);
Line: 1261

				hr_utility.set_location( 'delete appl row information1: ' || l_add_hist.information1|| l_proc, 52);
Line: 1262

				hr_utility.set_location( 'delete appl row effective_date: ' || l_add_hist.effective_date|| l_proc, 53);
Line: 1263

				delete_appl_row(
					p_table_name	=> l_add_hist.table_name,
					p_table_pk_id	=> l_add_hist.information1,
					p_dt_mode		=> null,
					p_date_effective	=> l_add_hist.effective_date);
Line: 1307

       ,p_delete_routine => 'ASSIGNMENT' );
Line: 1384

	ghr_agency_update.ghr_agency_upd(
			p_pa_request_rec			=> l_sf52_data,
			p_asg_sf52				=> l_imm_asg_sf52,
			p_asg_non_sf52			=> l_imm_asg_non_sf52,
			p_asg_nte_dates			=> l_imm_asg_nte_dates,
			p_per_sf52              	=> l_imm_per_sf52,
			p_per_group1            	=> l_imm_per_group1,
			p_per_group2            	=> l_imm_per_group2,
			p_per_scd_info          	=> l_imm_per_scd_info,
			p_per_retained_grade    	=> l_imm_per_retained_grade,
			p_per_probations			=> l_imm_per_probations,
			p_per_sep_Retire 	      	=> l_imm_per_sep_retire,
			p_per_security          	=> l_imm_per_security,
			p_per_conversions	      	=> l_imm_per_conversions,
			p_per_uniformed_services	=> l_imm_per_uniformed_services,
			p_pos_oblig                   => l_imm_pos_oblig,
			p_pos_grp2                    => l_imm_pos_grp2,
			p_pos_grp1                    => l_imm_pos_grp1,
			p_pos_valid_grade             => l_imm_pos_valid_grade,
			p_pos_car_prog                => l_imm_pos_car_prog,
			p_loc_info                    => l_imm_loc_info,
			p_wgi                         => l_imm_wgi,
			p_recruitment_bonus	      => l_imm_recruitment_bonus,
			p_relocation_bonus	      => l_imm_relocation_bonus ,
			p_sf52_from_data              => l_imm_sf52_from_data,
			p_personal_info	            => l_imm_personal_info,
			p_gov_awards_type             => l_imm_gov_awards,
			p_perf_appraisal_type         => l_imm_perf_appraisal,
			p_payroll_type                => l_imm_payroll_type,
			p_conduct_perf_type           => l_imm_conduct_performance,
			p_agency_code		      => l_agency_code,
			p_agency_sf52			=> l_imm_agency_sf52,
			p_entitlement                 => l_imm_entitlement,
			p_foreign_lang_prof_pay       => l_imm_foreign_lang_prof_pay,
			p_edp_pay                     => l_imm_edp_pay,
			p_hazard_pay                  => l_imm_hazard_pay,
			p_health_benefits             => l_imm_health_benefits,
			p_danger_pay                  => l_imm_danger_pay,
			p_imminent_danger_pay         => l_imm_imminent_danger_pay,
			p_living_quarters_allow       => l_imm_living_quarters_allow,
			p_post_diff_amt               => l_imm_post_diff_amt,
			p_post_diff_percent           => l_imm_post_diff_percent,
			p_sep_maintenance_allow       => l_imm_sep_maintenance_allow,
			p_supplemental_post_allow     => l_imm_supplemental_post_allow,
			p_temp_lodge_allow            => l_imm_temp_lodge_allow,
			p_premium_pay                 => l_imm_premium_pay,
			p_retirement_annuity          => l_imm_retirement_annuity,
			p_severance_pay               => l_imm_severance_pay,
			p_thrift_saving_plan          => l_imm_thrift_saving_plan,
			p_retention_allow_review      => l_imm_retention_allow_review,
			p_health_ben_pre_tax          => l_imm_health_ben_pre_tax,
			p_per_benefit_info            => l_imm_per_benefit_info,
			p_imm_retirement_info         => l_imm_retirement_info, --Bug# 7131104
			--Begin Bug# 10181661
			p_asg_detail_info	      => l_imm_asg_detail_info,
			p_ipa_detail_ben_cont_info    => l_imm_ipa_benefits_cont
			--End Bug# 10181661
			);
Line: 1444

	ghr_sf52_post_update.post_sf52_cancel(
		p_pa_request_id		=> p_sf52_data.pa_request_id,
		p_effective_date		=> l_session_var.date_effective,
		p_object_version_number	=> p_sf52_data.object_version_number,
		p_from_position_id	=> p_sf52_data.from_position_id,
		p_to_position_id		=> p_sf52_data.to_position_id,
		p_agency_code		=> p_sf52_data.agency_code);
Line: 1473

                  SELECT name, object_version_number
                    INTO l_pos_name, l_object_version_number
                    FROM hr_all_positions_f
                   WHERE position_id = l_par.from_position_id
                     AND (l_par.effective_date  - 1) BETWEEN effective_start_date
                                                               AND effective_end_date;
Line: 1479

                   hr_position_api.delete_position
                   (p_position_id                   => l_par.from_position_id,
                    p_object_version_number         => l_object_version_number,
                    p_effective_date                => l_par.effective_date - 1,
                    p_effective_start_date          => l_effective_start_date,
                    p_effective_end_date            => l_effective_end_date,
                    p_datetrack_mode                => 'DELETE_NEXT_CHANGE'
                    );
Line: 1490

		-- mark delete
		if l_par.first_noa_code not in ('001' , '002') then
			-- no need to do anything with cancellation/correction actions as they
			-- already will not appear in cancellation/correction form.
                        -- EDWARD NUNEZ 03/03/2000
                        -- NOTE: To fix bug# 1222525 please change following line
                        --       "if l_par.first_noa_cancel_or_correct is null then" to
                        --       "if l_par.first_noa_cancel_or_correct is null OR
                        --           NVL(l_par.first_noa_cancel_or_correct, '***') = 'CORRECT' then"
			if l_par.first_noa_cancel_or_correct is null or
                           NVL(l_par.first_noa_cancel_or_correct, '***') = 'CORRECT'
                        then
				l_par.first_noa_cancel_or_correct := ghr_history_api.g_cancel;
Line: 1524

		ghr_sf52_api.update_Sf52(
			p_pa_request_id                => l_par.pa_request_id,
			p_par_object_version_number    => l_par.object_version_number,
			p_first_noa_cancel_or_correct  => l_par.first_noa_cancel_or_correct,
			p_second_noa_cancel_or_correct => l_par.second_noa_cancel_or_correct,
			p_u_prh_object_version_number  => l_u_prh_object_version_number,
			p_i_pa_routing_history_id      => l_i_pa_routing_history_id,
			p_i_prh_object_version_number  => l_i_prh_object_version_number,
			p_u_action_taken               => 'NONE'
			);
Line: 1635

   	l_can_delete			boolean;
Line: 1717

   	l_deleted				boolean;
Line: 1739

   SELECT	*
   FROM		GHR_PA_HISTORY
   WHERE		pa_request_id		= cp_pa_request_id
   	AND	nature_of_action_id	= cp_noa_id
	ORDER BY DECODE(table_name, 'PAY_ELEMENT_ENTRY_VALUES_F', -2,
                                    'PAY_ELEMENT_ENTRIES_F', -1,
                        pa_history_id) asc;
Line: 1753

        SELECT 1
        FROM   PER_PERSON_ANALYSES
        WHERE  person_analysis_id = p_person_analysis_id;
Line: 1764

  Select paf.assignment_id
      from   per_assignments_f paf
      where  paf.person_id =   p_sf52_data.person_id
	  and	 paf.assignment_type='E'
      and    p_sf52_data.effective_date-1 between paf.effective_start_date and paf.effective_end_date;
Line: 1771

     Select par.first_noa_code,
            par.first_noa_id
     from   ghr_pa_requests par
     where  par.pa_request_id = p_sf52_data.altered_pa_request_id;
Line: 1777

    Select fam.noa_family_code
    from   ghr_noa_families nof,
           ghr_families fam
    where  nof.nature_of_action_id =  p_noa_id
    and    fam.noa_family_code     = nof.noa_family_code
    and    nvl(fam.proc_method_flag,hr_api.g_varchar2) = 'Y'
    and    p_sf52_data.effective_date
    between nvl(fam.start_date_active,p_sf52_data.effective_date)
    and     nvl(fam.end_date_active,p_sf52_data.effective_date);
Line: 1790

        select  pa_history_id
        from            ghr_pa_history
        where           table_name              = c_table_name
                and     information1    = c_pk_id
                and     pa_history_id   > c_pa_history_id;
Line: 1799

        select
                rowid row_id, table_name,pa_history_id,information5
                ,information9, information10
        from ghr_pa_history
        where pa_request_id = c_pa_request_id
        and   table_name = ghr_history_api.g_addres_table
        and  nature_of_action_id = c_noa_id
        for update of person_id
        order by pa_history_id desc;
Line: 1811

       Select distinct business_group_id bg
       from per_assignments_f
       where person_id = p_person_id
       and   p_eff_date between effective_start_date
             and effective_end_date;
Line: 1828

        SELECT elt.element_name
        FROM PAY_ELEMENT_LINKS_F ell,PAY_ELEMENT_TYPES_F elt
        WHERE ell.ELEMENT_type_id = elt.element_type_id
          AND ell.element_link_id = p_element_link_id;
Line: 1835

            SELECT elt.element_name
        FROM PAY_ELEMENT_LINKS_F ell,
             PAY_ELEMENT_TYPES_F elt,
             pay_element_entries_f ele
        WHERE ell.ELEMENT_type_id = elt.element_type_id
          AND ele.element_type_id = elt.element_type_id
          AND ell.element_link_id = ele.element_link_id
          AND ele.element_entry_id = p_element_entry_id;
Line: 1854

    SELECT   1
    FROM     ghr_pa_history
    WHERE    pa_request_id IN (SELECT pa_request_id FROM ghr_pa_requests
                               CONNECT BY pa_request_id = PRIOR altered_pa_request_id
			       START WITH pa_request_id = p_pa_request_id)
     AND     pa_history_id < p_pa_history_id
     AND     table_name   = p_table_name
     AND     information1 = p_information;
Line: 1936

	ghr_sf52_pre_update.populate_record_groups (
		 	p_pa_request_rec                => l_sf52_data,
			p_generic_ei_rec                => l_agency_ei_data,
			p_imm_asg_sf52                  => l_imm_asg_sf52,
			p_imm_asg_non_sf52              => l_imm_asg_non_sf52,
			p_imm_asg_nte_dates             => l_imm_asg_nte_dates,
			p_imm_asg_detail_info	        => l_imm_asg_detail_info, --Bug# 8653508
			p_imm_per_sf52                  => l_imm_per_sf52,
			p_imm_per_group1                => l_imm_per_group1,
			p_imm_per_group2                => l_imm_per_group2,
			p_imm_per_scd_info              => l_imm_per_scd_info,
			p_imm_per_retained_grade        => l_imm_per_retained_grade,
			p_imm_per_probations            => l_imm_per_probations,
			p_imm_per_sep_retire            => l_imm_per_sep_retire,
			p_imm_per_security              => l_imm_per_security,
            --Bug#4486823 RRR Changes
            p_imm_per_service_oblig         => l_imm_per_service_oblig,
			p_imm_per_conversions           => l_imm_per_conversions,
			-- 4352589 BEN_EIT Changes
			p_imm_per_benefit_info          => l_imm_per_benefit_info,
			p_imm_per_uniformed_services    => l_imm_per_uniformed_services,
			p_imm_pos_oblig                 => l_imm_pos_oblig,
			p_imm_pos_grp2                  => l_imm_pos_grp2,
			p_imm_pos_grp1                  => l_imm_pos_grp1,
			p_imm_pos_valid_grade           => l_imm_pos_valid_grade,
			p_imm_pos_car_prog              => l_imm_pos_car_prog,
			p_imm_loc_info                  => l_imm_loc_info,
			p_imm_wgi                       => l_imm_wgi,
			p_imm_gov_awards                => l_imm_gov_awards,
			p_imm_recruitment_bonus         => l_imm_recruitment_bonus,
			p_imm_relocation_bonus          => l_imm_relocation_bonus,
			p_imm_student_loan_repay        => l_imm_student_loan_repay,
			p_imm_per_race_ethnic_info 		=> l_imm_per_race_ethnic_info, -- Bug 4724337 Race or National Origin changes
			--Pradeep
			p_imm_mddds_special_pay         => l_imm_mddds_special_pay,
			p_imm_premium_pay_ind           => l_imm_premium_pay_ind,

			p_imm_perf_appraisal            => l_imm_perf_appraisal,
			p_imm_conduct_performance       => l_imm_conduct_performance,
			p_imm_payroll_type              => l_imm_payroll_type,
			p_imm_extra_info_rec	        => l_imm_extra_info_rec,
			p_imm_sf52_from_data            => l_imm_sf52_from_data,
			p_imm_personal_info	        => l_imm_personal_info,
			p_imm_generic_extra_info_rec    => l_imm_generic_extra_info_rec,
			p_imm_agency_sf52               => l_imm_agency_sf52,
			p_agency_code                   => l_agency_code,
			p_imm_par_term_retained_grade   => l_imm_par_term_retained_grade,
			p_imm_entitlement               => l_imm_entitlement,
                        -- Bug#2759379 Added FEGLI Record
                        p_imm_fegli                     => l_imm_fegli,
			p_imm_foreign_lang_prof_pay     => l_imm_foreign_lang_prof_pay,
			-- Bug#3385386 Added FTA Record
			p_imm_fta                       => l_imm_fta,
			p_imm_edp_pay                   => l_imm_edp_pay,
			p_imm_hazard_pay                => l_imm_hazard_pay,
			p_imm_health_benefits           => l_imm_health_benefits,
			p_imm_danger_pay                => l_imm_danger_pay,
			p_imm_imminent_danger_pay       => l_imm_imminent_danger_pay,
			p_imm_living_quarters_allow     => l_imm_living_quarters_allow,
			p_imm_post_diff_amt             => l_imm_post_diff_amt,
			p_imm_post_diff_percent         => l_imm_post_diff_percent,
			p_imm_sep_maintenance_allow     => l_imm_sep_maintenance_allow,
			p_imm_supplemental_post_allow   => l_imm_supplemental_post_allow,
			p_imm_temp_lodge_allow          => l_imm_temp_lodge_allow,
			p_imm_premium_pay               => l_imm_premium_pay,
			p_imm_retirement_annuity        => l_imm_retirement_annuity,
			p_imm_severance_pay             => l_imm_severance_pay,
			p_imm_thrift_saving_plan        => l_imm_thrift_saving_plan,
			p_imm_retention_allow_review        => l_imm_retention_allow_review,
			p_imm_health_ben_pre_tax           => l_imm_health_ben_pre_tax,
			--Bug# 6312144 RPA EIT Benefits
			p_imm_ipa_benefits_cont         => l_imm_ipa_benefits_cont,
                        p_imm_retirement_info           => l_imm_retirement_info,
			--BUG # 13571004 added TSP Roth
                        p_imm_tsp_roth                  => l_imm_roth_tsp
			);
Line: 2087

                       SELECT   *
                        INTO            l_hist_address_rec
                        FROM            ghr_pa_history
                        WHERE           pa_history_id   = l_hist.pa_history_id;
Line: 2108

                                        delete_appl_row(
                                                p_table_name    => ghr_history_api.g_addres_table,
                                                p_table_pk_id   => l_hist_address_rec.information1,
                                                p_dt_mode               => null,
                                                p_date_effective        => l_hist_address_rec.effective_date);
Line: 2126

                                delete_hist_row( l_hist.row_id);
Line: 2207

  				-- Call Delete_element_entry;
Line: 2208

  				-- delete all entry values from history;
Line: 2210

				-- To be able to delete this entry we have to pass previous record and
				-- ask to delete next change.
				-- If there is no pre-record then Call IF_ZAP_ELE_ENT to find if we need to zap
				-- the entry.
				l_result := FALSE;
Line: 2215

				l_del_mode := hr_api.g_delete_next_change;
Line: 2251

	  				delete_element_entry( p_hist_rec 		=> l_hist_pre,
								    p_del_mode          => l_del_mode,
  								    p_cannot_cancel 	=> l_cannot_cancel);
Line: 2260

					      hr_utility.set_location('Delete rows.'|| l_proc,40);
Line: 2261

  						delete_hist_row ( l_hist_rec.pa_history_id);
Line: 2262

  						delete_eleentval( l_hist_rec);
Line: 2272

				        delete_other_pay_entries(p_hist_rec => l_hist_rec,
				                             p_element_name => l_element_name);
Line: 2280

			-- Delete history record
  			delete_hist_row ( l_hist_rec.pa_history_id);
Line: 2288

			      hr_utility.set_location('Record was updated' || l_proc,48);
Line: 2315

					-- the same date and the update should not be applied to pay_element_entry_values_f table.
					-- If it is the same, then there are no intervening actions on the same date and the
					-- update should be applied.
					ghr_history_fetch.get_date_eff_eleevl(p_element_entry_value_id	=> l_hist_pre.information1,
											  p_date_effective		=> l_hist_rec.effective_date,
											  p_element_entry_data		=> l_date_eff_rec,
											  p_result_code			=> l_result_code,
											  p_pa_history_id			=> l_pa_history_id);
Line: 2334

						-- update element_entry_value here.
						-- update application table with pre-values
						update_eleentval	(p_hist_pre		=>	l_hist_pre);
Line: 2340

			-- Delete history record
  			delete_hist_row ( l_hist_rec.pa_history_id);
Line: 2355

			-- Determine if this record was created or updated.
			if l_datetrack_table then
                                  hr_utility.set_location('In Cancel - Date track table' ,1);
Line: 2362

				-- if this sf50 updated the row, then the pre must have the same date.
				-- The triggers work such that we will only have update from sf50 operation
				-- when the effective_date is the same. If the pre has a different effective
				-- date, then the original row that was created must have been deleted due to
				-- a cancellation. In this case, the current row becomes the row that was created
				-- by the sf52. So, we must set the rec_created_flag to true for this row. Note
				-- this stands true with date tracked tables only as with non-date tracked tables there
				-- is only one row in a record, so this case will never occur.
				elsif l_hist_rec.DML_operation = ghr_history_api.g_upd_operation then
                                               hr_utility.set_location('in Cancel - DML - Upd' ,1);
Line: 2391

  				p_can_delete		=>	l_can_delete,
  				p_last_row			=>	l_last_row,
  				p_cannot_cancel		=>	l_cannot_cancel);
Line: 2413

			-- delete row under conditions outlined below.
			l_deleted	:= FALSE;
Line: 2416

  			if (l_can_delete = TRUE) then
			      hr_utility.set_location('CAN delete'|| l_proc,60);
Line: 2425

  						l_datetrack_mode	:= hr_api.g_delete_next_change;
Line: 2430

  				-- only do the delete if this is a datetrack table or if it is the only row of a
  				-- non datetrack table. In all other cases, cascade will properly handle it.

  				if (l_datetrack_table = TRUE or (l_last_row = TRUE and l_pre_record = FALSE)) then
					hr_utility.set_location('Deleting Application row'|| l_proc,80);
Line: 2435

					l_deleted := TRUE;
Line: 2436

  					delete_appl_row(	p_table_name	=> 	l_hist_rec.table_name,
  								p_table_pk_id	=>	l_hist_rec.information1,
  								p_dt_mode		=>	l_datetrack_mode,
  								p_date_effective	=>	l_hist_rec.effective_date);
Line: 2444

			-- Delete history record
  			delete_hist_row ( l_hist_rec.pa_history_id);
Line: 2446

  			-- cascade changes thru application table, if the application table record was not already deleted above.
                        if (l_deleted = FALSE)
                                     or (l_datetrack_mode   = hr_api.g_delete_next_change) then
                          if (l_deleted = FALSE) then
                          hr_utility.set_location('deleted is false : Bef cascade appl_table',1);
Line: 2453

                          hr_utility.set_location('delete next change : Bef cascade appl_table',1);
Line: 2455

			-- Sundar Bug#2872298 Cascade should not occur if records are already deleted and
				-- delete mode in DELETE_NEXT_CHANGE
				IF (l_deleted = TRUE) AND (l_datetrack_mode   = hr_api.g_delete_next_change) --AND (p_sf52_data.second_noa_code = '790')
				THEN
						   NULL;
Line: 2526

	ghr_agency_update.ghr_agency_upd(
			p_pa_request_rec			=> l_sf52_data,
			p_asg_sf52				=> l_imm_asg_sf52,
			p_asg_non_sf52			=> l_imm_asg_non_sf52,
			p_asg_nte_dates			=> l_imm_asg_nte_dates,
			p_per_sf52              	=> l_imm_per_sf52,
			p_per_group1            	=> l_imm_per_group1,
			p_per_group2            	=> l_imm_per_group2,
			p_per_scd_info          	=> l_imm_per_scd_info,
			p_per_retained_grade    	=> l_imm_per_retained_grade,
			p_per_probations			=> l_imm_per_probations,
			p_per_sep_Retire 	      	=> l_imm_per_sep_retire,
			p_per_security          	=> l_imm_per_security,
			p_per_conversions	      	=> l_imm_per_conversions,
			p_per_uniformed_services	=> l_imm_per_uniformed_services,
			p_pos_oblig                   => l_imm_pos_oblig,
			p_pos_grp2                    => l_imm_pos_grp2,
			p_pos_grp1                    => l_imm_pos_grp1,
			p_pos_valid_grade             => l_imm_pos_valid_grade,
			p_pos_car_prog                => l_imm_pos_car_prog,
			p_loc_info                    => l_imm_loc_info,
			p_wgi                         => l_imm_wgi,
			p_recruitment_bonus	      => l_imm_recruitment_bonus,
			p_relocation_bonus	      => l_imm_relocation_bonus ,
			p_sf52_from_data              => l_imm_sf52_from_data,
			p_personal_info	            => l_imm_personal_info,
			p_gov_awards_type             => l_imm_gov_awards,
			p_perf_appraisal_type         => l_imm_perf_appraisal,
			p_payroll_type                => l_imm_payroll_type,
			p_conduct_perf_type           => l_imm_conduct_performance,
			p_agency_code		      => l_agency_code,
			p_agency_sf52			=> l_imm_agency_sf52,
			p_entitlement                 => l_imm_entitlement,
			p_foreign_lang_prof_pay       => l_imm_foreign_lang_prof_pay,
			p_edp_pay                     => l_imm_edp_pay,
			p_hazard_pay                  => l_imm_hazard_pay,
			p_health_benefits             => l_imm_health_benefits,
			p_danger_pay                  => l_imm_danger_pay,
			p_imminent_danger_pay         => l_imm_imminent_danger_pay,
			p_living_quarters_allow       => l_imm_living_quarters_allow,
			p_post_diff_amt               => l_imm_post_diff_amt,
			p_post_diff_percent           => l_imm_post_diff_percent,
			p_sep_maintenance_allow       => l_imm_sep_maintenance_allow,
			p_supplemental_post_allow     => l_imm_supplemental_post_allow,
			p_temp_lodge_allow            => l_imm_temp_lodge_allow,
			p_premium_pay                 => l_imm_premium_pay,
			p_retirement_annuity          => l_imm_retirement_annuity,
			p_severance_pay               => l_imm_severance_pay,
			p_thrift_saving_plan          => l_imm_thrift_saving_plan,
			p_retention_allow_review      => l_imm_retention_allow_review,
			p_health_ben_pre_tax          => l_imm_health_ben_pre_tax,
			p_per_benefit_info            => l_imm_per_benefit_info,
			p_imm_retirement_info         => l_imm_retirement_info, --Bug# 7131104
			--Begin Bug# 10181661
			p_asg_detail_info	      => l_imm_asg_detail_info,
			p_ipa_detail_ben_cont_info    => l_imm_ipa_benefits_cont
			--End Bug# 10181661
			);
Line: 2586

	ghr_sf52_post_update.post_sf52_cancel(
		p_pa_request_id		=> p_sf52_data.pa_request_id,
		p_effective_date		=> l_session_var.date_effective,
		p_object_version_number	=> p_sf52_data.object_version_number,
		p_from_position_id	=> p_sf52_data.from_position_id,
		p_to_position_id		=> p_sf52_data.to_position_id,
		p_agency_code		=> p_sf52_data.agency_code);
Line: 2657

	select
		fams.noa_family_code
	from  ghr_noa_families noafam,
		ghr_families     fams
	where noafam.nature_of_action_id = c_noa_id               and
		noafam.enabled_flag        = 'Y'                    and
		fams.noa_family_code 	   = noafam.noa_family_code and
		fams.enabled_flag          = 'Y'                    and
		fams.update_hr_flag = 'Y';
Line: 2668

	select *
	from ghr_pa_requests
		connect by pa_request_id = prior altered_pa_request_id
		start with pa_request_id = c_pa_request_id
	order by level desc;
Line: 2675

	select
		min(pa_history_id)
	from ghr_pa_history
	where pa_request_id = c_pa_request_id;
Line: 2681

	select *
	from ghr_pa_request_shadow
	where pa_request_id = c_pa_request_id;
Line: 2691

	    select 'Y'
	    from   ghr_pa_requests
	    where  pa_request_id = (select min(pa_request_id)
     	                            from   ghr_pa_requests
               	                    where  pa_notification_id is not null
	                            connect by pa_request_id = prior altered_pa_request_id
	                            start with pa_request_id = c_pa_request_id)
            and   second_noa_code is not null
	    and   first_noa_code not in ('001','002');
Line: 2717

	select pa_history_id
	from ghr_pa_history
	where pa_request_id = p_sf52_rec.altered_pa_request_id and
		nature_of_action_id = p_sf52_rec.second_noa_id;
Line: 2821

	ghr_process_sf52.update_rfrs_values(p_sf52_data		=>	l_sf52_data,
							p_shadow_data	=>	l_shadow_data);
Line: 2861

	ghr_process_sf52.update_rfrs_values(p_sf52_data		=>	l_root_sf52,
							p_shadow_data	=>	l_shadow_data);
Line: 2925

	hr_utility.set_location('national_identifier right before update sf52: '|| l_sf52_data_result.employee_national_identifier || l_proc, 915);
Line: 2926

	hr_utility.set_location('from_step_or_rate right before update sf52: '|| l_sf52_data_result.from_step_or_rate || l_proc, 915);
Line: 2927

	hr_utility.set_location('to_step_or_rate right before update sf52: '|| l_sf52_data_result.to_step_or_rate || l_proc, 915);
Line: 2931

      ghr_sf52_validn_pkg.prelim_req_chk_for_update_hr(p_pa_request_rec       =>  l_sf52_data_result);
Line: 2936

		ghr_sf52_update.main( 	p_pa_request_rec    	=> 	l_sf52_data_result,
						p_pa_request_ei_rec 	=>	l_sf52_ei_data,
						p_generic_ei_rec		=> 	l_agency_ei_data,
                                                p_capped_other_pay => p_capped_other_pay);
Line: 2944

		ghr_sf52_update.main( 	p_pa_request_rec    	=> 	l_sf52_data_result,
						p_pa_request_ei_rec 	=>	l_sf52_ei_data,
						p_generic_ei_rec		=> 	l_agency_ei_data,
                                                p_capped_other_pay => p_capped_other_pay);
Line: 2948

	hr_utility.set_location('to_position_id right before update sf52: '|| l_sf52_data_result.to_position_id || l_proc, 915);
Line: 2949

     hr_utility.set_location('After main update :'|| l_proc, 20);
Line: 2950

                ghr_sf52_post_update.Post_sf52_process(
                        p_pa_request_id         => p_sf52_data.pa_request_id,
                        p_effective_date                => l_session_var.date_effective,
                        p_object_version_number => l_sf52_data1.object_version_number,
                        p_from_position_id      => l_sf52_data_result.from_position_id,
                        p_to_position_id                => l_sf52_data_result.to_position_id,
                        p_agency_code           => l_sf52_data_result.agency_code,
                        p_sf52_data_result      => l_sf52_data_result,
                        p_called_from           => 'CORRECTION_SF52'
                );
Line: 2994

Procedure delete_hist_row ( p_row_id 	in	rowid) is
	l_proc	varchar2(30):='delete_hist_row';
Line: 2998

	delete ghr_pa_history
		where rowid = p_row_id;
Line: 3001

End delete_hist_row;
Line: 3032

Procedure delete_hist_row ( p_pa_history_id 	in	ghr_pa_history.pa_history_id%type) is
	l_proc	varchar2(30):='delete_hist_row';
Line: 3036

	delete ghr_pa_history
		where pa_history_id = p_pa_history_id;
Line: 3039

End delete_hist_row;
Line: 3494

	select 	*
	from 		ghr_pa_requests
	connect by 	prior altered_pa_request_id = pa_request_id
	start with	pa_request_id = p_sf52_data.pa_request_id
	order by 	level desc;
Line: 3501

        select pa_request_id,pa_notification_id,person_id,
               effective_date,from_position_id,
               to_position_id
        from ghr_pa_requests
        where pa_request_id = p_sf52_data.altered_pa_request_id;
Line: 3508

	select
		min(pa_history_id)
	from ghr_pa_history
	where pa_request_id = c_pa_request_id;
Line: 3517

        select gdf.segment1
              ,gdf.segment2
          from per_grades grd,
               per_grade_definitions gdf
         where grd.grade_id = grd_id
           and grd.grade_definition_id = gdf.grade_definition_id;
Line: 3533

       select  1
       from    ghr_pa_history hist_1
       where   pa_request_id is null
       and     hist_1.pa_history_id > (select min(pa_history_id)
                                       from ghr_pa_history
	  			       where pa_request_id = l_prev_request_id)
       and     hist_1.pa_history_id < nvl(l_curr_pa_history_id,999999999)
       and     information1 in   (select  to_char(position_extra_info_id)
                                  from    per_position_extra_info
                                  where   position_id          =  p_to_position_id
                                  and     information_type     in  ('GHR_US_POS_GRP1'))
       and     information5   =  'GHR_US_POS_GRP1'
       and     effective_date =  p_effective_date
       and     table_name     =  'PER_POSITION_EXTRA_INFO';
Line: 3899

				p_can_delete	 out nocopy 	boolean,
				p_last_row		 out nocopy 	boolean,
				p_cannot_cancel	 out nocopy 	boolean) IS
   	l_proc		varchar2(72) := 'what_to_do?';
Line: 3906

  	p_can_delete 	:= FALSE;
Line: 3922

					-- there is no pre and no following records, so we CAN cancel and we CAN delete. And this is
					-- the last row in history.
   					p_can_delete 	:= TRUE;
Line: 3939

					p_can_delete := TRUE;
Line: 3955

				p_can_delete := TRUE;
Line: 3964

           p_can_delete     := null;
Line: 4001

   Procedure delete_element_entry( p_hist_rec 		in 	ghr_pa_history%rowtype,
					     p_del_mode		in	varchar2 default hr_api.g_delete_next_change,
   					     p_cannot_cancel out nocopy Boolean) is
   	l_del_warning	boolean;
Line: 4005

	-- this cursor selects the element_entry_id and object_version_number from
	-- pay_element_entries_f for the element_entry_id and date_effective passed.
   	cursor c_elmt ( cp_element_entry_id number,
   			    cp_date_Effective	date) is
   	select element_entry_id,
   		 object_version_number
   	from pay_element_entries_f
  	where element_entry_id = cp_element_entry_id and
 		cp_date_effective between effective_start_date and effective_end_date;
Line: 4017

  	l_proc	varchar2(30):='delete_element_entry';
Line: 4039

  		PY_element_entry_api.delete_element_entry(
 			p_datetrack_delete_mode		=>	nvl(p_del_mode, hr_api.g_delete_next_change),
  			p_effective_date		=>	to_date(p_hist_rec.information2, ghr_history_conv_rg.g_hist_date_format),
  			p_element_entry_id		=>	l_c_elmt.element_entry_id,
  			p_object_version_number		=>	l_c_elmt.object_version_number,
  			p_effective_start_date		=>	l_eff_start_date,
  			p_effective_end_date		=>	l_eff_end_date,
  			p_delete_warning			=>	l_del_warning);
Line: 4060

 End delete_element_entry;
Line: 4093

PROCEDURE update_eleentval(	p_hist_pre	in	ghr_pa_history%rowtype) IS
	-- this cursor selects the input value name given the input_value_id and effective date.

        CURSOR 	c_input_value (cp_input_value_id     in number
          		       ,cp_eff_date          in date
				,p_bg_id             in NUMBER)
	IS
        		SELECT 	IPV.NAME
          		FROM		PAY_INPUT_VALUES_F IPV
         		WHERE  	TRUNC(cp_eff_date)
			        BETWEEN IPV.EFFECTIVE_START_DATE AND IPV.EFFECTIVE_END_DATE
          		AND 	IPV.INPUT_VALUE_ID = cp_input_value_id;
Line: 4107

	-- this cursor selects the element name given the element_entry_id and effective date.
	CURSOR	c_element_name(	cp_element_entry_id 	in	number
				,cp_eff_date		in	date
				,p_bg_id                IN      number)
	IS
			SELECT 	ELT.ELEMENT_NAME
			FROM		PAY_ELEMENT_TYPES_F	ELT,
					PAY_ELEMENT_LINKS_F	ELL,
					PAY_ELEMENT_ENTRIES_F	ELE
			WHERE	TRUNC(cp_eff_date)	BETWEEN	ELT.EFFECTIVE_START_DATE
									AND	ELT.EFFECTIVE_END_DATE
			AND	TRUNC(cp_eff_date)	BETWEEN	ELL.EFFECTIVE_START_DATE
									AND	ELL.EFFECTIVE_END_DATE
			AND	TRUNC(cp_eff_date)	BETWEEN	ELE.EFFECTIVE_START_DATE
									AND	ELE.EFFECTIVE_END_DATE
			AND	ELE.ELEMENT_ENTRY_ID	= 	cp_element_entry_id
			AND	ELL.ELEMENT_LINK_ID	=	ELE.ELEMENT_LINK_ID
			AND	ELT.ELEMENT_TYPE_ID	= 	ELL.ELEMENT_TYPE_ID
                        AND    (ELT.BUSINESS_GROUP_ID is null OR ELT.BUSINESS_GROUP_ID = p_bg_id);
Line: 4134

			SELECT	ASSIGNMENT_ID
			FROM		GHR_PA_HISTORY
			WHERE		INFORMATION1	=	cp_information1
				AND	INFORMATION2	= 	cp_information2
				AND 	INFORMATION3	=	cp_information3
				AND	TABLE_NAME		= 	cp_table_name
                        ORDER BY PROCESS_DATE DESC;  -- Line Added by ENUNEZ (04/11/2000) bug# 1235958
Line: 4145

	l_proc		varchar2(30):='update_eleentval';
Line: 4154

             select ipv.uom
          from pay_element_types_f elt,
               pay_input_values_f ipv
         where trunc(eff_date) between elt.effective_start_date
                                   and elt.effective_end_date
           and trunc(eff_date) between ipv.effective_start_date
                                   and ipv.effective_end_date
           and elt.element_type_id = ipv.element_type_id
           and upper(elt.element_name) = upper(ele_name)
           and upper(ipv.name) = upper(input_name);
Line: 4171

SELECT business_group_id bg
FROM   per_assignments_f
WHERE  person_id = p_person_id
AND    p_eff_Date between effective_start_Date
       AND effective_end_Date;
Line: 4183

SELECT pcv_information1 ele_name
FROM   pqp_configuration_Values
WHERE  pcv_information_category='PQP_FEDHR_ELEMENT'
AND    business_group_id is NULL and legislation_code='US'
AND    upper(pcv_information1)=upper(p_ele_name);
Line: 4300

	/*To be included after Martin Reid's element api handles the create and update warning
	if l_proc_warn = FALSE then
     	hr_utility.set_message(8301,'GHR_99999_FL_TO_UPD_ELEMENT_FOR_CANC');
Line: 4307

END update_eleentval;
Line: 4338

  Procedure delete_eleentval( p_hist_rec in ghr_pa_history%rowtype) is
	-- this cursor gets the rowid of the history_rec for the ghr_pa_history row passed
	-- to us.
  	cursor c_hist is
  	select rowid row_id
  	from ghr_pa_history
  	where table_name			= ghr_history_api.g_eleevl_table	and
  		pa_request_id		= p_hist_rec.pa_request_id		and
  		nature_of_action_id	= p_hist_rec.nature_of_action_id
  	for update of table_name;
Line: 4348

	l_proc		varchar2(30):='delete_eleentval';
Line: 4353

  		delete_hist_row( c_data.row_id);
Line: 4356

  end delete_eleentval;
Line: 4389

  PROCEDURE	delete_peop_row(	p_person_id		in	varchar2,
  					p_dt_mode		in	varchar2,
  					p_date_effective	in	date) IS
  	l_proc	varchar2(72) 	:= 	'delete_per_people_f_row';
Line: 4398

  	SELECT object_version_number
  	FROM	PER_PEOPLE_F
  	WHERE person_id = cp_person_id
  		AND cp_date_effective between effective_start_date and effective_end_date;
Line: 4404

  	if (p_dt_mode = hr_api.g_delete_next_change) then
  		open c_get_ovn(p_person_id, p_date_effective -1);
Line: 4408

			-- can't delete without object_version_number.
			close c_get_ovn;
Line: 4426

			-- can't delete without object_version_number.
			close c_get_ovn;
Line: 4444

  END delete_peop_row;
Line: 4448

  PROCEDURE	delete_posn_row(	p_position_id		in	varchar2,
  					p_dt_mode		in	varchar2,
  					p_date_effective	in	date) IS
  	l_proc	varchar2(72) 	:= 	'delete_hr_all_positions_f_row';
Line: 4458

  	SELECT object_version_number
  	FROM	HR_ALL_POSITIONS_F
  	WHERE position_id = cp_position_id
  		AND cp_date_effective between effective_start_date and effective_end_date;
Line: 4466

            select object_version_number
            from per_all_positions
            where position_id = p_position_id;
Line: 4474

            SELECT psf.position_definition_id
            FROM hr_all_positions_f psf
            WHERE position_id = c_position_id
            AND effective_end_date = hr_api.g_eot
            FOR UPDATE;
Line: 4503

  	if (p_dt_mode = hr_api.g_delete_next_change) then
  		open c_get_ovn(p_position_id, p_date_effective -1);
Line: 4507

			-- can't delete without object_version_number.
			close c_get_ovn;
Line: 4525

                  update hr_all_positions_f
                  set copied_to_old_table_flag = 'N'
                  where position_id = p_position_id and
                  effective_end_date > p_date_effective - 1;
Line: 4541

			-- can't delete without object_version_number.
			close c_get_ovn;
Line: 4575

  END delete_posn_row;
Line: 4608

  PROCEDURE	delete_asgn_row(	p_assignment_id	in	varchar2,
  					p_dt_mode		in	varchar2,
  					p_date_effective	in	date) IS
  	l_proc	varchar2(72) 	:= 	'delete_per_assignments_f_row';
Line: 4622

  	SELECT object_version_number
  	FROM	PER_ASSIGNMENTS_F
  	WHERE assignment_id = cp_assignment_id
 		AND cp_date_effective between effective_start_date and effective_end_date;
Line: 4629

Select ppp.pay_proposal_id       proposal_id
       ,ppp.object_version_number ovn
from   per_pay_proposals ppp
where  ppp.assignment_id = p_assignment_id
and    change_date  <= p_eff_date;
Line: 4654

  	if (p_dt_mode = hr_api.g_delete_next_change) then
  		open c_get_ovn(p_assignment_id, p_date_effective -1);
Line: 4658

			-- can't delete without object_version_number.
  			-- raise error;
Line: 4679

			-- can't delete without object_version_number.
  			-- raise error;
Line: 4718

	          p_datetrack_mode            => 'DELETE_NEXT_CHANGE',
	          p_org_now_no_manager_warning => l_org_now_no_manager_warning  );
Line: 4721

	 /* hr_maintain_proposal_api.delete_salary_proposal
                (
                p_pay_proposal_id      => l_pay_proposal_id ,
                p_business_group_id    => l_business_group_id         ,
                p_object_version_number => l_sal_admin_ovn            ,
                p_validate              => FALSE            ,
                p_salary_warning        => l_sal_warn
                ); */
Line: 4740

             hr_entry_api.delete_element_entry
	                   ('DELETE_NEXT_CHANGE',
	                    p_date_effective - 1,
	                    l_ele_entry_id  );
Line: 4764

  END delete_asgn_row;
Line: 4795

  PROCEDURE	delete_peopei_row(	p_person_extra_info_id	in	varchar2) IS
  	l_proc	varchar2(72) 	:= 	'delete_per_people_extra_info_row';
Line: 4799

  	SELECT object_version_number
  	FROM	PER_PEOPLE_EXTRA_INFO
  	WHERE person_extra_info_id = cp_person_extra_info_id ;
Line: 4807

		-- can't do delete without object_version_number.
		close c_get_ovn;
Line: 4810

		-- if record is not there means it has already been deleted thru core form.
	      -- hr_utility.set_message(8301,'GHR_38217_PEI_OVN_NOTFOUND');
Line: 4818

  END delete_peopei_row;
Line: 4849

  PROCEDURE	delete_asgnei_row(	p_assignment_extra_info_id	in	varchar2) IS
  	l_proc	varchar2(72) 	:= 	'delete_per_assignment_extra_info_row';
Line: 4854

  	SELECT object_version_number
  	FROM	PER_ASSIGNMENT_EXTRA_INFO
  	WHERE assignment_extra_info_id = cp_assignment_extra_info_id ;
Line: 4862

		-- can't do delete without object_version_number.
		close c_get_ovn;
Line: 4865

		-- if record is not there means it has already been deleted thru core form.
	      -- hr_utility.set_message(8301,'GHR_38218_ASGEI_OVN_NOTFOUND');
Line: 4873

  END delete_asgnei_row;
Line: 4903

  PROCEDURE	delete_posnei_row(	p_position_extra_info_id	in	varchar2) IS
  	l_proc	varchar2(72) 	:= 	'delete_per_position_extra_info_row';
Line: 4908

  	SELECT object_version_number
  	FROM	PER_POSITION_EXTRA_INFO
  	WHERE position_extra_info_id = cp_position_extra_info_id ;
Line: 4916

		-- can't do delete without object_version_number.
		close c_get_ovn;
Line: 4919

		-- if record is not there means it has already been deleted thru core form.
	      -- hr_utility.set_message(8301,'GHR_38218_ASGEI_OVN_NOTFOUND');
Line: 4927

  END delete_posnei_row;
Line: 4958

  PROCEDURE	delete_address_row(	p_address_id	in	varchar2) IS

  	l_proc	varchar2(72) 	:= 	'delete_per_addresses_row';
Line: 4963

  	SELECT object_version_number
  	FROM	PER_ADDRESSES
  	WHERE address_id = cp_address_id ;
Line: 4972

		-- can't do delete without object_version_number.
		close c_get_ovn;
Line: 4975

		-- if record is not there means it has already been deleted thru core form.
	      -- hr_utility.set_message(8301,'GHR_38220_ADDRESS_OVN_NOTFOUND');
Line: 4984

  END delete_address_row;
Line: 5015

  PROCEDURE delete_person_analyses_row ( p_person_analysis_id	in	number) is

  	l_proc	varchar2(72) 	:= 	'delete_person_analyses_row';
Line: 5020

  	SELECT object_version_number
  	FROM	PER_PERSON_ANALYSES
  	WHERE person_analysis_id = cp_person_analysis_id ;
Line: 5029

		-- can't do delete without object_version_number.
  		-- raise error;
Line: 5033

		-- if record is not there means it has already been deleted thru core form.
	      -- hr_utility.set_message(8301,'GHR_38272_PERSON_ANALYSE_OV_NF');
Line: 5042

  End delete_person_analyses_row;
Line: 5075

  PROCEDURE	delete_appl_row(	p_table_name	in	varchar2,
  					p_table_pk_id	in	varchar2,
  					p_dt_mode		in	varchar2,
  					p_date_effective	in	date) IS
  	l_proc	varchar2(72) 	:= 	'delete_appl_row';
Line: 5084

  		delete_peop_row(		p_person_id	=>	p_table_pk_id,
  						p_dt_mode		=>	p_dt_mode,
  						p_date_effective	=>	p_date_effective);
Line: 5089

  		delete_posn_row(		p_position_id	=>	p_table_pk_id,
  						p_dt_mode		=>	p_dt_mode,
  						p_date_effective	=>	p_date_effective);
Line: 5093

  		delete_asgn_row(		p_assignment_id	=>	p_table_pk_id,
  						p_dt_mode		=>	p_dt_mode,
  						p_date_effective	=>	p_date_effective);
Line: 5097

  		delete_peopei_row(	p_person_extra_info_id	=>	p_table_pk_id);
Line: 5099

  		delete_asgnei_row(	p_assignment_extra_info_id	=>	p_table_pk_id);
Line: 5101

  		delete_posnei_row(	p_position_extra_info_id	=>	p_table_pk_id);
Line: 5103

  		delete_address_row(	p_address_id	=>	p_table_pk_id);
Line: 5105

  		delete_person_analyses_row(	p_person_analysis_id	=>	p_table_pk_id);
Line: 5108

  END delete_appl_row;
Line: 5145

	select
		pa_request_id,
		altered_pa_request_id,
		first_noa_id,
		second_noa_id,
		object_version_number ovn
	from ghr_pa_requests
	where pa_request_id = cp_pa_request_id;
Line: 5352

	-- this cursor selects all rows in the correction chain from ghr_pa_requests
	cursor  l_sf52_cursor is
	select 	*
	from 		ghr_pa_requests
	connect by 	prior altered_pa_request_id = pa_request_id
	start with	pa_request_id = p_pa_request_id
	order by 	level desc;
Line: 5368

   select *
   from ghr_pa_requests
   where pa_request_id = p_pa_request_id;
Line: 5373

        select pa_request_id,pa_notification_id,person_id,
               effective_date,from_position_id,
               to_position_id
        from ghr_pa_requests
        where pa_request_id in (
            select  altered_pa_request_id from
             ghr_pa_requests where pa_request_id = p_pa_request_id);
Line: 5385

            select gdf.segment1
                  ,gdf.segment2
              from per_grades grd,
                   per_grade_definitions gdf
             where grd.grade_id = grd_id
               and grd.grade_definition_id = gdf.grade_definition_id;
Line: 5687

    select fam.noa_family_code family_code
    from ghr_noa_families fam
    where fam.nature_of_action_id = c_noa_id;
Line: 5831

    SELECT *
    INTO l_sf52_data
    FROM ghr_pa_requests
    WHERE pa_request_id = p_pa_request_id;
Line: 5931

	select
		pet.effective_start_date,
		pet.effective_end_date,
		pet.processing_type
	from
		pay_element_types_f pet, pay_element_links_f pel, pay_element_entries_f pee
	where pee.element_entry_id 	= cp_element_entry_id and
		pee.element_link_id	= pel.element_link_id and
		pet.element_type_id	= pel.element_type_id and
		cp_effective_start_date between pee.effective_start_date and pee.effective_end_date and
		cp_effective_start_date between pet.effective_start_date and pet.effective_end_date and
		cp_effective_start_date between pel.effective_start_date and pel.effective_end_date ;
Line: 5945

	select min(pa_history_id)
	from ghr_pa_history
	where pa_request_id = (select min(pa_request_id)
					from ghr_pa_requests
					start with pa_request_id = (select pa_request_id -- Bug# 1253981
										from ghr_pa_history
										where pa_history_id = cp_pa_history_id)
					connect by  prior altered_pa_request_id  =  pa_request_id)
--					connect by pa_request_id = altered_pa_request_id)
		and nature_of_action_id = (select nature_of_action_id
							from ghr_pa_history
							where pa_history_id = cp_pa_history_id); */
Line: 5963

	select min(pa_history_id)
	from ghr_pa_history
	where pa_request_id = (select pa_request_id -- Bug# 1253981
				from ghr_pa_history
				where pa_history_id = cp_pa_history_id);
Line: 5978

		Select   pa_history_id
		from     ghr_pa_history  pah
		where    table_name 	      = ghr_history_api.g_eleevl_table
		and      information5 	      = c_information1
		and      (effective_date      > c_effective_date   or
			   (effective_date      = c_effective_date  and
			    c_root_hist_id      <
						(select min(pa_history_id)
						from ghr_pa_history
						where pa_request_id =
						(select 	min(pa_request_id)
						from 		ghr_pa_requests
						connect by 	prior altered_pa_request_id 	=  pa_request_id
						start with 	pa_request_id 		= 	pah.pa_request_id))));
Line: 6061

	select
		 pa_request_id
		,object_version_number
		,status
		,rowid row_id
	from ghr_pa_requests
	where (level = 1 or ( level > 1 								and
		nvl(second_noa_cancel_or_correct, '@#$') <> ghr_history_api.g_cancel))	and
		first_noa_code <> '001'									and
		nvl(status, '@!#') <> 'CANCELED'
	start with pa_request_id = c_pa_request_id
	connect by  prior pa_request_id	= altered_pa_request_id and
			prior c_noa_id 		= second_noa_id;
Line: 6142

		elsif nvl(l_subsequent_pa_req(l_rev_count).status, 'CANCELED') <> 'UPDATE_HR_COMPLETE' then
			-- SF52 has not been processed
			-- Soft Cancel this SF52
			-- No need to re-fetch object_version_number. As this must be last SF52 in the chain and
			-- OVN must not change since last fetch
			hr_utility.set_location('Soft Cancelling SF52 :  ' ||
				l_subsequent_pa_req(l_rev_count).pa_request_id || '  ' || l_proc , 90);
Line: 6232

	select
		*
	from ghr_pa_requests
	where pa_request_id = c_pa_request_id;
Line: 6239

	select
		fams.noa_family_code
	from  ghr_noa_families noafam,
		ghr_families     fams
	where noafam.nature_of_action_id = c_noa_id               and
		noafam.enabled_flag        = 'Y'                    and
		fams.noa_family_code 	   = noafam.noa_family_code and
		fams.enabled_flag          = 'Y'                    and
		fams.update_hr_flag = 'Y';
Line: 6255

	    select  per_in_ler_id, ptnl_ler_for_per_stat_cd
	    from    ben_per_in_ler pil,
	            ben_ler_f lf,
	            ben_ptnl_ler_for_per ptnl
            where pil.person_id = p_person_id
            and pil.business_group_id = p_business_group_id
            and pil.lf_evt_ocrd_dt = p_effective_date
            and pil.PER_IN_LER_STAT_CD IN ('PROCD','STRTD')
            and lf.ler_id = pil.ler_id
	    and pil.ptnl_ler_for_per_id = ptnl.ptnl_ler_for_per_id
            and name <> 'Unrestricted'
            and p_effective_date between lf.effective_start_date
                                 and lf.effective_end_date;
Line: 6273

	    select per_in_ler_id,PER_IN_LER_STAT_CD
	    from ben_per_in_ler pil,ben_ler_f lf
            where pil.person_id = p_person_id
            and pil.business_group_id = p_business_group_id
            and pil.lf_evt_ocrd_dt = p_effective_date
            and PER_IN_LER_STAT_CD IN ('PROCD','STRTD')
            and lf.ler_id = pil.ler_id
            and name = 'Unrestricted'
            and p_effective_date between lf.effective_start_date
                                 and lf.effective_end_date;
Line: 6287

	    select 1
	    from   ghr_pa_requests par
	    where  person_id = p_person_id
	    and    effective_date <= p_effective_date
	    and    first_noa_code not in ('100')
	    and    pa_notification_id is not null
	    and    not exists (select 1
	                       from  ghr_pa_requests b
			       where person_id = p_person_id
			       and   altered_pa_request_id = par.pa_request_id
			       and   first_noa_code = '001'
			       and   second_noa_code = par.first_noa_code);
Line: 6304

            select   business_group_id bg_id
            from     per_all_people_f
            where    person_id = c_person_id
            and      c_effective_date between effective_start_date
	                              and     effective_end_date;
Line: 6314

	    select pgm.pgm_id
	    from   ben_pgm_f pgm
	    where  pgm.name = c_prog_name
	    and    pgm.business_group_id  = c_business_group_id
	    and    c_effective_date between effective_start_date and effective_end_date;
Line: 6325

            select prtt_enrt_rslt_id,
	           object_version_number,
		   effective_start_date,
		   enrt_cvg_thru_dt
   	    from   ben_prtt_enrt_rslt_f
	    where  person_id = p_person_id
	    and    pgm_id    = p_pgm_id
	    and    per_in_ler_id = p_per_in_ler_id
	    and    p_effective_date between effective_start_date and effective_end_date
	    and    enrt_cvg_strt_dt >= p_effective_date;
Line: 6404

                      hr_utility.set_location('Hiring Status - Calling Delete API',45);
Line: 6405

                      hr_position_api.delete_position(p_validate              => FALSE
                                                     ,p_position_id           => to_number(l_sf52_data.from_position_id)
                                                     ,p_effective_date        => l_posn_eff_start_date-1
                                                     ,p_effective_start_date  => l_posn_eff_start_date
                                                     ,p_effective_end_date    => l_posn_eff_end_date
                                                     ,p_object_version_number => l_prior_posn_ovn
                                                     ,p_datetrack_mode        => 'DELETE_NEXT_CHANGE');
Line: 6461

              		    l_datetrack_mode := hr_api.g_delete_next_change;
Line: 6490

   			               ben_prtt_enrt_result_api.delete_enrollment
						 (p_validate              => false
						 ,p_per_in_ler_id         => rec_le.per_in_ler_id
						 ,p_prtt_enrt_rslt_id     => enrt_rec.prtt_enrt_rslt_id
						 ,p_business_group_id     => l_bg_id
						 ,p_effective_start_date  => l_effective_start_date
						 ,p_effective_end_date    => l_effective_end_date
						 ,p_object_version_number => l_object_version_number
						 ,p_effective_date        => enrt_rec.effective_start_date
						 ,p_datetrack_mode        => hr_api.g_zap
						 ,p_enrt_cvg_thru_dt      => enrt_rec.enrt_cvg_thru_dt
						 ,p_multi_row_validate    => FALSE);
Line: 6519

		--		-- user defined families not supported by update to database
		--		-- should generate a message and raise_error here.
		--		hr_utility.set_location( l_proc, 80);
Line: 6559

          select employee_assignment_id
            from ghr_pa_requests
            where pa_request_id in
          ( select altered_pa_request_id from
             ghr_pa_requests where
             pa_request_id =  p_corr_sf52_detail.pa_request_id);
Line: 6636

	-- Call update_sf52
	-- This is a recursive call as Process_SF52 is called from ghr_sf52_api.update_sf52
	hr_utility.set_location(' BEGIN Update_SF52 for pa_request_id : ' ||
					l_sf52_canc.pa_request_id || '  ' || l_proc , 110);
Line: 6643

	ghr_sf52_api.update_sf52(
		 p_pa_request_id			=> l_sf52_canc.pa_request_id
                 ,p_employee_assignment_id       => l_asg_id
		-- OUT parameters
		,p_par_object_version_number	=> l_sf52_canc.object_version_number
		,p_u_prh_object_version_number=> l_dummy_number
		,p_i_pa_routing_history_id	=> l_dummy_number
		,p_i_prh_object_version_number=> l_dummy_number
		,p_u_action_taken			=> 'UPDATE_HR'
		,p_u_approval_status		=> 'APPROVE'
	);
Line: 6655

	hr_utility.set_location(' END Update_SF52 for pa_request_id : ' ||
					l_sf52_canc.pa_request_id || '  ' || l_proc , 120);
Line: 6664

	-- Delete GHR_Routing_History
	delete from ghr_pa_routing_history
	where pa_request_id = l_sf52_canc.pa_request_id;
Line: 6669

      delete ghr_pa_request_ei_shadow
      where  pa_request_id = l_sf52_canc.pa_request_id;
Line: 6672

	-- Delete Cancelation SF50 Shadow row
	hr_utility.set_location(' Deleting Shadow ' || l_sf52_canc.pa_request_id || '  ' || l_proc , 130);
Line: 6674

	Delete from ghr_pa_request_shadow
	where pa_request_id = l_sf52_canc.pa_request_id;
Line: 6679

      delete ghr_pa_request_extra_info
      where  pa_request_id = l_sf52_canc.pa_request_id;
Line: 6682

	-- Delete pa_reques row
	l_sf52_canc.object_version_number := get_sf52_ovn( l_sf52_canc.pa_request_id);
Line: 6718

Procedure delete_other_pay_entries(p_hist_rec in ghr_pa_history%rowtype,
                                   p_element_name IN VARCHAR2 ) IS

l_history_exists               BOOLEAN := FALSE;
Line: 6728

SELECT *
FROM  ghr_pa_history
WHERE table_name = 'PAY_ELEMENT_ENTRIES_F'
AND   information1 = p_hist_rec.information1
AND   information2 = p_hist_rec.information2
AND   nvl(pa_request_id,0) <> nvl(p_hist_rec.pa_request_id,0);
Line: 6738

SELECT min(effective_date) effective_date
FROM ghr_pa_requests
where noa_family_code = 'OTHER_PAY'
and pa_notification_id is not null
and effective_date > p_effective_date
and status = 'UPDATE_HR_COMPLETE'
and employee_assignment_id = p_assignment_id
and NVL(first_noa_cancel_or_correct,'C') <> 'CANCEL';
Line: 6749

    hr_utility.set_location('Entering Delete Oth Pay Entr '||p_element_name,0);
Line: 6775

	    --   Delete the other pay element from this effective date to the future
	    --   other pay action (effective date - 1).
	    -- Else
	    --   Delete the Other Pay element with this element entry ID.
	    -- End If;
Line: 6782

		    --  DELETE THE RECORD FROM PAY_ELEMENT_ENTRY_VALUES_F;
Line: 6783

		    DELETE pay_element_entry_values_f
		    where  element_entry_id = p_hist_rec.information1
		    AND    effective_start_date BETWEEN fnd_date.canonical_to_date(p_hist_rec.information2)
		                                    AND (l_future_othpay_effective_date - 1) ;
Line: 6789

		    --	DELETE THE RECORD FROM PAY_ELEMENT_ENTRIES_F;
Line: 6790

		    DELETE PAY_ELEMENT_ENTRIES_F
		    where  element_entry_id = p_hist_rec.information1
		    AND    effective_start_date BETWEEN fnd_date.canonical_to_date(p_hist_rec.information2)
		                                    AND (l_future_othpay_effective_date - 1) ;
Line: 6795

		    -- DELETE THE HISTORY RECORDS with the same element entry ID created after the current
		    -- action and prior to the next other pay action.
		    DELETE ghr_pa_history
                    WHERE (information5 = p_hist_rec.information1
                       OR  information1 = p_hist_rec.information1)
                      AND effective_date BETWEEN (fnd_date.canonical_to_date(p_hist_rec.information2) + 1)
		                             AND (l_future_othpay_effective_date - 1);
Line: 6805

		    --	DELETE THE RECORD FROM PAY_ELEMENT_ENTRY_VALUES_F;
Line: 6806

		    DELETE pay_element_entry_values_f
		    where  element_entry_id = p_hist_rec.information1;
Line: 6810

		    --	DELETE THE RECORD FROM PAY_ELEMENT_ENTRIES_F;
Line: 6811

		    DELETE PAY_ELEMENT_ENTRIES_F
		    where  element_entry_id = p_hist_rec.information1;
Line: 6814

		    -- DELETE THE HISTORY RECORDS with the same element entry ID created after the
		    -- current other pay action.
		    DELETE ghr_pa_history
                    WHERE (information5 = p_hist_rec.information1 OR  information1 = p_hist_rec.information1)
                      AND effective_date > (fnd_date.canonical_to_date(p_hist_rec.information2) + 1);
Line: 6824

	--	DELETE THE RECORD FROM PAY_ELEMENT_ENTRY_VALUES_F;
Line: 6826

        DELETE pay_element_entry_values_f
        where  element_entry_id = p_hist_rec.information1;
Line: 6832

        DELETE PAY_ELEMENT_ENTRIES_F
        where  element_entry_id = p_hist_rec.information1;
Line: 6836

        hr_utility.set_location('Leaving delete_other_pay_entries',170);
Line: 6842

        DELETE pay_element_entry_values_f
        where  element_entry_id = p_hist_rec.information1
        AND    effective_start_date = fnd_date.canonical_to_date(p_hist_rec.information2);
Line: 6848

        DELETE PAY_ELEMENT_ENTRIES_F
        where  element_entry_id = p_hist_rec.information1
        AND    effective_start_date = fnd_date.canonical_to_date(p_hist_rec.information2);
Line: 6852

        hr_utility.set_location('Leaving delete_other_pay_entries',70);
Line: 6858

        hr_utility.set_location('Leaving delete_other_pay_entries',90);
Line: 6859

END delete_other_pay_entries;
Line: 6867

	select
		object_version_number
	from ghr_pa_requests
	where pa_request_id = c_pa_request_id;
Line: 6892

SELECT * FROM ghr_pa_requests
WHERE pa_request_id = p_pa_request_id;
Line: 6899

SELECT grade_id
FROM per_grades
WHERE business_group_id = c_business_group_id
AND substr(name,1,2) = c_pay_plan
AND substr(name,length(name)-1) = c_grade
AND c_effective_date BETWEEN NVL(date_from,to_date('01/01/1951','dd/mm/yyyy')) AND NVL(date_to,to_date('31/12/4712','dd/mm/yyyy'));
Line: 7001

    SELECT  '1'
      FROM    pay_element_types_f        elt
             ,pay_element_entries_f      ele
      WHERE  elt.element_type_id    = ele.element_type_id
      AND    elt.element_name= p_element_name
      AND    ele.assignment_id      = p_assignment_id
      AND    elt.business_group_id is NULL
      AND    p_effective_date BETWEEN elt.effective_start_date AND elt.effective_end_date
      AND    p_effective_date BETWEEN ele.effective_start_date AND ele.effective_end_date;
Line: 7013

       select fam.noa_family_code
        from ghr_noa_families fam
       where fam.nature_of_action_id = p_noa_id;
Line: 7108

 select apf.effective_start_date, apf.effective_end_date
 from   HR_ALL_POSITIONS_F apf
 where  apf.position_id = p_position_id
 and    apf.availability_status_id <> 1
 and    p_effective_date between apf.effective_start_date and apf.effective_end_date;
Line: 7115

 select apf.object_version_number
 from   HR_ALL_POSITIONS_F apf
 where  apf.position_id = p_position_id
 and    p_posn_eff_start_date-1 between apf.effective_start_date and apf.effective_end_date;
Line: 7139

    select *
    from   ghr_pa_requests
    where  pa_request_id = p_pa_request_id;
Line: 7263

       select 	*
       from 		ghr_pa_requests
       connect by 	prior altered_pa_request_id = pa_request_id
       start with	pa_request_id = p_sf52_data.pa_request_id
       order by 	level desc;
Line: 7271

       select pa_request_id,pa_notification_id,person_id,
              effective_date,from_position_id,
              to_position_id,noa_family_code,second_noa_code
       from ghr_pa_requests
       where pa_request_id = p_sf52_data.altered_pa_request_id;
Line: 7279

       select min(pa_history_id)
       from ghr_pa_history
       where pa_request_id = c_pa_request_id;
Line: 7288

       select gdf.segment1
             ,gdf.segment2
       from per_grades grd,
            per_grade_definitions gdf
       where grd.grade_id = grd_id
       and   grd.grade_definition_id = gdf.grade_definition_id;
Line: 7305

       select  1
       from    ghr_pa_history hist_1
       where   pa_request_id is null
       and     hist_1.pa_history_id > (select min(pa_history_id)
                                       from ghr_pa_history
	  			       where pa_request_id = l_prev_request_id)
       and     hist_1.pa_history_id < nvl(l_curr_pa_history_id,999999999)
       and     information1 in   (select  to_char(position_extra_info_id)
                                  from    per_position_extra_info
                                  where   position_id          =  p_to_position_id
                                  and     information_type     in  ('GHR_US_POS_GRP1'))
       and     information5   =  'GHR_US_POS_GRP1'
       and     effective_date =  p_effective_date
       and     table_name     =  'PER_POSITION_EXTRA_INFO';
Line: 7325

       SELECT pos.job_id
             ,pos.business_group_id
             ,pos.organization_id
             ,pos.location_id
       FROM  hr_all_positions_f           pos  -- Venkat -- Position DT
       WHERE pos.position_id = p_position_id
       and  p_effective_date between pos.effective_start_date
                             and pos.effective_end_date ;
Line: 7338

        Select fam.noa_family_code
        from   ghr_noa_families nof,
               ghr_families fam
        where  nof.nature_of_action_id =  p_noa_id
        and    fam.noa_family_code     = nof.noa_family_code
        and    nvl(fam.proc_method_flag,hr_api.g_varchar2) = 'Y'
        and    p_sf52_data.effective_date
        between nvl(fam.start_date_active,p_sf52_data.effective_date)
        and     nvl(fam.end_date_active,p_sf52_data.effective_date);
Line: 7351

     select 1
     from   ghr_pa_requests
     where  pa_request_id = p_pa_request_id
     and    pa_request_id > mass_action_id
     and    second_noa_code = (select second_noa_code
                               from ghr_pa_requests
   		               where pa_request_id = (select 	  min(pa_request_id)
				         	       from 	  ghr_pa_requests
						       where      pa_notification_id is not null
						       connect by pa_request_id = prior altered_pa_request_id
						       start with pa_request_id = p_pa_request_id));