The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select NVL( max( tp.end_date), p_start_date )
From per_time_periods tp,
pay_payroll_actions ppa,
per_all_assignments_f aaf
Where aaf.assignment_id = p_assignment_id
and (aaf.effective_end_date >= p_start_date and aaf.effective_start_date <= p_end_date)
and ppa.payroll_id = aaf.payroll_id
and (ppa.date_earned between tp.start_date and tp.end_date )
AND tp.payroll_id = aaf.payroll_id
AND (tp.start_date <= least(p_end_date,aaf.effective_end_date)
and tp.end_date >= greatest(p_start_date,aaf.effective_start_date) )
and tp.time_period_id = ppa.time_period_id;
Select NVL( tp.end_date, p_start_date )
from pay_assignment_actions paa,
per_all_assignments_f paf,
pay_payroll_actions ppa,
pay_action_classifications pac,
per_time_periods tp
where paf.assignment_id = p_assignment_id
and (paf.effective_end_date >= p_start_date
and paf.effective_start_date <= p_end_date)
and paa.assignment_id = paf.assignment_id
and ppa.payroll_action_id = paa.payroll_action_id
and ppa.effective_date +0 between
greatest(p_start_date,paf.effective_start_date)
and least(p_end_date,paf.effective_end_date)
and pac.action_type = ppa.action_type
and pac.classification_name = 'SEQUENCED'
and ((nvl(paa.run_type_id, ppa.run_type_id) is null and
paa.source_action_id is null)
or (nvl(paa.run_type_id, ppa.run_type_id) is not null and
paa.source_action_id is not null )
or (ppa.action_type = 'V' and ppa.run_type_id is null and
paa.run_type_id is not null and
paa.source_action_id is null))
and tp.time_period_id = ppa.time_period_id
order by paa.action_sequence desc;
Select bvr.budget_id
From pqh_budget_versions bvr
Where bvr.budget_version_id = p_budget_version_id;
Select null
From hr_all_positions_f
Where position_id = p_position_id;
Select null
From pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bdt.position_id = p_position_id;
Select null
From per_jobs
Where job_id = p_job_id;
Select null
From pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bdt.job_id = p_job_id;
Select null
From per_grades
Where grade_id = p_grade_id;
Select null
From pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bdt.grade_id = p_grade_id;
Select null
From hr_organization_units
Where organization_id = p_organization_id;
Select null
From pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bdt.organization_id = p_organization_id;
Select null
From per_all_assignments_f
Where assignment_id = p_assignment_id;
Select null From pay_element_types_f
Where element_type_id = p_element_type_id;
Select system_type_cd
From per_shared_types
Where shared_type_id = p_unit_of_measure_id
AND lookup_type = 'BUDGET_MEASUREMENT_TYPE';
Select null
From pqh_budgets
Where budget_id = p_budget_id
AND (budget_unit1_id = p_unit_of_measure_id OR
budget_unit2_id = p_unit_of_measure_id OR
budget_unit3_id = p_unit_of_measure_id);
Select budget_start_date,budget_end_date
From pqh_budgets
Where budget_id = p_budget_id;
Select budget_start_date,budget_end_date
From pqh_budgets
Where budget_id = p_budget_id;
SELECT O3.ORG_INFORMATION9 legislation_code
FROM HR_ORGANIZATION_INFORMATION O3
WHERE O3.ORGANIZATION_ID = p_business_group_id
AND O3.ORG_INFORMATION_CONTEXT = 'Business Group Information';
Select psf.business_group_id
from hr_all_positions_f psf
Where psf.position_id = p_position_id
and rownum < 2;
SELECT NVL(SUM(ABV.VALUE),0)
FROM per_assignment_budget_values_f abv
WHERE abv.assignment_id = p_assignment_id
AND abv.unit = p_unit_of_measure
AND (p_period_end_dt BETWEEN abv.effective_start_date AND
abv.effective_end_date)
AND abv.assignment_id =
(select assignment_id
from per_all_assignments_f asg,
per_assignment_status_types ast
where asg.assignment_id = p_assignment_id
AND asg.assignment_type = 'E'
AND (p_period_end_dt BETWEEN asg.effective_start_date AND
asg.effective_end_date)
AND asg.assignment_status_type_id = ast.assignment_status_type_id
AND ast.per_system_status <> 'TERM_ASSIGN');
select classification_id
from pay_element_classifications
where classification_name in ('Employer Liabilities', 'Earnings','Supplemental Earnings')
and legislation_code = p_legislation_code;
SELECT max(aa.end_Date) last_payroll_dt, sum(RRV.RESULT_VALUE * get_factor(aa.start_date, aa.end_date,
greatest(p_actuals_start_date,aa.start_date), least(p_actuals_end_date,aa.end_date))) result_value
FROM
PAY_INPUT_VALUES_F INV,PAY_RUN_RESULT_VALUES RRV,
PAY_ELEMENT_TYPES_F PET,
PAY_RUN_RESULTS RES,
(
Select tp.start_date, tp.end_date, aac.assignment_action_id
From per_time_periods tp,
pay_payroll_actions ppa,
PAY_ASSIGNMENT_ACTIONS AAC
Where tp.payroll_id=p_payroll_id
AND (tp.start_date <= p_actuals_end_date and tp.end_date >= p_actuals_start_date)
and tp.payroll_id = ppa.payroll_id
and ppa.payroll_id = p_payroll_id
and tp.time_period_id = ppa.time_period_id
and ppa.date_earned between tp.start_date and tp.end_date
AND PPA.PAYROLL_ACTION_ID = AAC.PAYROLL_ACTION_ID
AND AAC.ASSIGNMENT_ID = p_assignment_id) AA
WHERE RES.ASSIGNMENT_ACTION_ID = aa.assignment_action_id
AND RES.STATUS IN ( 'P','PA' )
AND PET.CLASSIFICATION_ID in (
select classification_id
from pay_element_classifications
where classification_name in ('Employer Liabilities', 'Earnings','Supplemental Earnings')
and legislation_code = 'US'
)
AND PET.ELEMENT_TYPE_ID = p_element_type_id
AND aa.start_date BETWEEN PET.EFFECTIVE_START_DATE AND PET.EFFECTIVE_END_DATE
AND PET.ELEMENT_TYPE_ID = RES.ELEMENT_TYPE_ID
AND PET.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND RES.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND INV.NAME = 'Pay Value'
AND aa.start_date BETWEEN INV.EFFECTIVE_START_DATE AND INV.EFFECTIVE_END_DATE
AND RRV.RUN_RESULT_ID = RES.RUN_RESULT_ID
AND RRV.INPUT_VALUE_ID = INV.INPUT_VALUE_ID;
SELECT max(aa.end_Date) last_payroll_dt, sum(RRV.RESULT_VALUE * get_factor(aa.start_date, aa.end_date,
greatest(p_actuals_start_date,aa.start_date), least(p_actuals_end_date,aa.end_date))) result_value
FROM
PAY_INPUT_VALUES_F INV,PAY_RUN_RESULT_VALUES RRV,
PAY_ELEMENT_TYPES_F PET,
PAY_RUN_RESULTS RES,
(
Select tp.start_date, tp.end_date, aac.assignment_action_id
From per_time_periods tp,
pay_payroll_actions ppa,
PAY_ASSIGNMENT_ACTIONS AAC
Where tp.payroll_id=p_payroll_id
AND (tp.start_date <= p_actuals_end_date and tp.end_date >= p_actuals_start_date)
and tp.payroll_id = ppa.payroll_id
and ppa.payroll_id = p_payroll_id
and tp.time_period_id = ppa.time_period_id
and ppa.date_earned between tp.start_date and tp.end_date
AND PPA.PAYROLL_ACTION_ID = AAC.PAYROLL_ACTION_ID
AND AAC.ASSIGNMENT_ID = p_assignment_id) AA
WHERE RES.ASSIGNMENT_ACTION_ID = aa.assignment_action_id
AND RES.STATUS IN ( 'P','PA' )
AND PET.CLASSIFICATION_ID in (
select classification_id
from pay_element_classifications
where classification_name in ('Employer Liabilities', 'Earnings','Supplemental Earnings')
and legislation_code = 'US' )
AND aa.start_date BETWEEN PET.EFFECTIVE_START_DATE AND PET.EFFECTIVE_END_DATE
AND PET.ELEMENT_TYPE_ID = RES.ELEMENT_TYPE_ID
AND PET.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND RES.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND INV.NAME = 'Pay Value'
AND aa.start_date BETWEEN INV.EFFECTIVE_START_DATE AND INV.EFFECTIVE_END_DATE
AND RRV.RUN_RESULT_ID = RES.RUN_RESULT_ID
AND RRV.INPUT_VALUE_ID = INV.INPUT_VALUE_ID;
select 1
from dual
where exists
(select null
from pay_assignment_actions
where assignment_id = p_assignment_id);
SELECT max(aa.end_Date) last_payroll_dt, sum(RRV.RESULT_VALUE * get_factor(aa.start_date, aa.end_date,
greatest(p_actuals_start_date,aa.start_date), least(p_actuals_end_date,aa.end_date))) result_value
FROM
PAY_INPUT_VALUES_F INV,PAY_RUN_RESULT_VALUES RRV,
PAY_ELEMENT_TYPES_F PET,
PAY_RUN_RESULTS RES,
(
Select tp.start_date, tp.end_date, aac.assignment_action_id
From per_time_periods tp,
pay_payroll_actions ppa,
PAY_ASSIGNMENT_ACTIONS AAC
Where tp.payroll_id=p_payroll_id
AND (tp.start_date <= p_actuals_end_date and tp.end_date >= p_actuals_start_date)
and tp.payroll_id = ppa.payroll_id
and ppa.payroll_id = p_payroll_id
and tp.time_period_id = ppa.time_period_id
and ppa.date_earned between tp.start_date and tp.end_date
AND PPA.PAYROLL_ACTION_ID = AAC.PAYROLL_ACTION_ID
AND AAC.ASSIGNMENT_ID = p_assignment_id) AA
WHERE RES.ASSIGNMENT_ACTION_ID = aa.assignment_action_id
AND RES.STATUS IN ( 'P','PA' )
AND PET.ELEMENT_TYPE_ID = p_element_type_id
AND aa.start_date BETWEEN PET.EFFECTIVE_START_DATE AND PET.EFFECTIVE_END_DATE
AND PET.ELEMENT_TYPE_ID = RES.ELEMENT_TYPE_ID
AND PET.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND RES.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
-- AND INV.INPUT_VALUE_ID = p_ele_input_value_id --'Pay Value'
AND INV.NAME = 'Pay Value'
AND aa.start_date BETWEEN INV.EFFECTIVE_START_DATE AND INV.EFFECTIVE_END_DATE
AND RRV.RUN_RESULT_ID = RES.RUN_RESULT_ID
AND RRV.INPUT_VALUE_ID = INV.INPUT_VALUE_ID;
select 1
from dual
where exists
(select null
from pay_assignment_actions
where assignment_id = p_assignment_id);
Select max(tp.end_date)
From per_time_periods tp,
pay_payroll_actions ppa,
PAY_ASSIGNMENT_ACTIONS AAC
Where tp.payroll_id=p_payroll_id
and (tp.start_date <= p_actuals_end_date and tp.end_date >= p_actuals_start_date)
and tp.payroll_id = ppa.payroll_id
and ppa.payroll_id = p_payroll_id
and tp.time_period_id = ppa.time_period_id
and ppa.date_earned between tp.start_date and tp.end_date
and ppa.payroll_action_id = aac.payroll_action_id
and aac.assignment_id = p_assignment_id;
select 1
from dual
where exists
(select null
from pay_assignment_actions
where assignment_id = p_assignment_id);
select 1
from pqh_bdgt_cmmtmnt_elmnts
where actual_commitment_type in ('ACTUAL','BOTH')
and budget_id = p_budget_id;
select element_type_id,element_input_value_id, balance_type_id
from pqh_bdgt_cmmtmnt_elmnts
where actual_commitment_type in ('ACTUAL','BOTH') and
element_type_id = nvl(p_element_type_id,element_type_id)
and budget_id = p_budget_id;
select defined_balance_id
from pay_defined_balances def, pay_balance_dimensions dim
where def.balance_type_id = p_balance_type_id
and def.balance_dimension_id = dim.balance_dimension_id
and dim.database_item_suffix = p_dim_suf
and save_run_balance = 'Y';
select paa.assignment_action_id
from pay_assignment_actions paa, pay_payroll_actions ppa
where paa.payroll_action_id = ppa.payroll_action_id
and paa.source_action_id is null
and paa.assignment_id = c_assignment_id
and ppa.effective_date = (select max(effective_date) from pay_payroll_actions ppa1
where ppa1.payroll_action_id = paa.payroll_action_id
and paa.assignment_id = c_assignment_id
and ppa.effective_date <= c_effective_date);
select prb.balance_value
from pay_run_balances prb, pay_assignment_actions paa
where prb.assignment_id = c_assignment_id
and prb.defined_balance_id = c_defined_balance_id
and prb.assignment_action_id = paa.assignment_action_id
and paa.source_action_id is not null
and prb.effective_date =
(select max(effective_date)
from pay_run_balances prb1
where prb1.effective_date <= c_effective_date
and prb1.assignment_id = c_assignment_id and prb1.defined_balance_id = c_defined_balance_id);
select classification_id
from pay_element_classifications
where classification_name in ('Employer Liabilities', 'Earnings','Supplemental Earnings')
and legislation_code = p_legislation_code;
SELECT sum(RRV.RESULT_VALUE) result_value
FROM
PAY_INPUT_VALUES_F INV,PAY_RUN_RESULT_VALUES RRV,
PAY_ELEMENT_TYPES_F PET,
PAY_RUN_RESULTS RES
WHERE RES.ASSIGNMENT_ACTION_ID = p_assignment_action_id
AND RES.STATUS IN ( 'P','PA' )
AND PET.CLASSIFICATION_ID = cl_id
AND PET.ELEMENT_TYPE_ID = p_element_type_id
AND p_start_date BETWEEN PET.EFFECTIVE_START_DATE AND PET.EFFECTIVE_END_DATE
AND PET.ELEMENT_TYPE_ID = RES.ELEMENT_TYPE_ID
AND PET.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND RES.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND INV.NAME = 'Pay Value'
AND p_start_date BETWEEN INV.EFFECTIVE_START_DATE AND INV.EFFECTIVE_END_DATE
AND RRV.RUN_RESULT_ID = RES.RUN_RESULT_ID
AND RRV.INPUT_VALUE_ID = INV.INPUT_VALUE_ID;
SELECT sum(RRV.RESULT_VALUE) result_value
FROM
PAY_INPUT_VALUES_F INV,PAY_RUN_RESULT_VALUES RRV,
PAY_ELEMENT_TYPES_F PET,
PAY_RUN_RESULTS RES
WHERE RES.ASSIGNMENT_ACTION_ID = p_assignment_action_id
AND RES.STATUS IN ( 'P','PA' )
AND PET.CLASSIFICATION_ID = cl_id
AND p_start_date BETWEEN PET.EFFECTIVE_START_DATE AND PET.EFFECTIVE_END_DATE
AND PET.ELEMENT_TYPE_ID = RES.ELEMENT_TYPE_ID
AND PET.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND RES.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND INV.NAME = 'Pay Value'
AND p_start_date BETWEEN INV.EFFECTIVE_START_DATE AND INV.EFFECTIVE_END_DATE
AND RRV.RUN_RESULT_ID = RES.RUN_RESULT_ID
AND RRV.INPUT_VALUE_ID = INV.INPUT_VALUE_ID;
Select /*+ ORDERED */
tp.start_date,tp.end_date, aac.assignment_action_id
From per_time_periods tp,
pay_payroll_actions ppa,
PAY_ASSIGNMENT_ACTIONS AAC
Where tp.payroll_id=p_payroll_id
AND (tp.start_date <= p_actuals_end_date
and
tp.end_date >= p_actuals_start_date)
and tp.payroll_id = ppa.payroll_id
and ppa.payroll_id = p_payroll_id
and tp.time_period_id = ppa.time_period_id
and ppa.date_earned between tp.start_date and tp.end_date
AND PPA.PAYROLL_ACTION_ID = AAC.PAYROLL_ACTION_ID
AND AAC.ASSIGNMENT_ID = p_assignment_id
order by tp.end_date;
select 1
from dual
where exists
(select null
from pay_assignment_actions
where assignment_id = p_assignment_id);
Select ASSG.assignment_id,
ASSG.payroll_id,
ASSG.business_group_id,
ASSG.effective_start_date,
ASSG.effective_end_date
From per_all_assignments_f ASSG
Where ASSG.assignment_id = p_assignment_id
AND ASSG.effective_end_date >= p_actuals_start_date
AND ASSG.effective_start_date <= p_actuals_end_date ;
Select nvl(commitment_amount,0),
commitment_start_date,commitment_end_date
From pqh_element_commitments
Where budget_version_id = p_budget_version_id
AND assignment_id = p_assignment_id
AND element_type_id = nvl(p_element_type_id,element_type_id)
AND commitment_start_date <= p_period_end_date
AND commitment_end_date >= p_period_start_date;
Select budget_version_id
From pqh_element_commitments
Where assignment_id = p_assignment_id
AND (p_start_date <= commitment_end_date AND
commitment_start_date <= p_end_date);
Select distinct ASSG.assignment_id
From per_all_assignments_f ASSG
Where ASSG.position_id = p_position_id
AND ASSG.effective_end_date >= p_start_date
AND ASSG.effective_start_date <= p_end_date;
Select frequency , working_hours
From hr_all_positions_f
Where p_effective_date between effective_start_date and effective_end_date
And position_id = p_position_id;
SELECT O2.ORG_INFORMATION4 , O2.ORG_INFORMATION3
FROM HR_ORGANIZATION_INFORMATION O2
WHERE O2.ORG_INFORMATION_CONTEXT = 'Work Day Information'
AND O2.organization_id = p_organization_id;
SELECT O2.ORG_INFORMATION4 , O2.ORG_INFORMATION3
FROM HR_ORGANIZATION_INFORMATION O2
WHERE O2.ORG_INFORMATION_CONTEXT = 'Work Day Information'
AND O2.organization_id = p_bg_id;
select effective_start_date, effective_end_date,frequency, normal_hours, time_normal_start, time_normal_finish,
position_id,organization_id,business_group_id
from per_all_assignments_f
where p_assignment_id = assignment_id
and effective_start_date = p_asg_start_date;
select assignment_id, effective_start_date
from per_all_assignments_f
where organization_id = p_organization_id
and business_group_id = p_business_grp_id
and effective_end_date >= p_start_date
and effective_start_date <= p_end_date ;
select assignment_id, effective_start_date
from per_all_assignments_f
where p_position_id = position_id
and effective_end_date >= p_start_date
and effective_start_date <= p_end_date ;
select assignment_id, effective_start_date
from per_all_assignments_f
where p_job_id = job_id
and effective_end_date >= p_start_date
and effective_start_date <= p_end_date ;
select assignment_id, effective_start_date
from per_all_assignments_f
where p_grade_id = grade_id
and effective_end_date >= p_start_date
and effective_start_date <= p_end_date ;
Select distinct ASSG.assignment_id
From per_all_assignments_f ASSG
Where ASSG.position_id = p_position_id
AND ASSG.effective_end_date >= p_start_date
AND ASSG.effective_start_date <= p_end_date
AND ASSG.assignment_id <> p_ex_assignment_id;
Select distinct ASSG.assignment_id
From per_all_assignments_f ASSG
Where ASSG.position_id = p_entity_id
and business_group_id = p_business_group_id
AND ASSG.effective_end_date >= p_start_date
AND ASSG.effective_start_date <= p_end_date;
Select distinct ASSG.assignment_id
From per_all_assignments_f ASSG
Where ASSG.job_id = p_entity_id
and business_group_id = p_business_group_id
AND ASSG.effective_end_date >= p_start_date
AND ASSG.effective_start_date <= p_end_date;
Select distinct ASSG.assignment_id
From per_all_assignments_f ASSG
Where ASSG.grade_id = p_entity_id
and business_group_id = p_business_group_id
AND ASSG.effective_end_date >= p_start_date
AND ASSG.effective_start_date <= p_end_date ;
Select distinct ASSG.assignment_id
From per_all_assignments_f ASSG
Where ASSG.organization_id = p_entity_id
and business_group_id = p_business_group_id
AND ASSG.effective_end_date >= p_start_date
AND ASSG.effective_start_date <= p_end_date;
Select business_group_id
From pqh_budgets
Where budget_id = l_budget_id;
Select Position_id
From pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bdt.position_id IS NOT NULL;
Select Position_id
From pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bdt.position_id IS NOT NULL;
Select Position_id
From pqh_budgets bgt,pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_id = bgt.budget_id
AND bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bgt.budgeted_entity_cd = 'POSITION';
Select job_id
From pqh_budgets bgt,pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_id = bgt.budget_id
AND bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bgt.budgeted_entity_cd = 'JOB';
Select grade_id
From pqh_budgets bgt,pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_id = bgt.budget_id
AND bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bgt.budgeted_entity_cd = 'GRADE';
Select organization_id
From pqh_budgets bgt,pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_id = bgt.budget_id
AND bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bgt.budgeted_entity_cd = 'ORGANIZATION';
Select Position_id
From pqh_budgets bgt,pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_id = bgt.budget_id
AND bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bgt.budgeted_entity_cd = 'POSITION';
Select job_id
From pqh_budgets bgt,pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_id = bgt.budget_id
AND bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bgt.budgeted_entity_cd = 'JOB';
Select grade_id
From pqh_budgets bgt,pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_id = bgt.budget_id
AND bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bgt.budgeted_entity_cd = 'GRADE';
Select organization_id
From pqh_budgets bgt,pqh_budget_details bdt,pqh_budget_versions bvr
Where bvr.budget_id = bgt.budget_id
AND bvr.budget_version_id = p_budget_version_id
AND bvr.budget_version_id = bdt.budget_version_id
AND bgt.budgeted_entity_cd = 'ORGANIZATION';
select bgt.budget_id, budget_version_id, budget_start_date, budget_end_date
from pqh_budgets bgt, pqh_budget_versions ver
where bgt.budget_id = ver.budget_id
and (p_effective_date between date_from and date_to)
and position_control_flag = 'Y'
and budgeted_entity_cd = p_budget_entity
and business_group_id = p_business_group_id -- Line added Bug Fix : 2432715
and (p_start_date <= budget_end_date
and p_end_date >= budget_start_date)
and ( hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = p_unit_of_measure
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = p_unit_of_measure
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = p_unit_of_measure);
select distinct assg.assignment_id
from per_all_assignments_f assg
where business_group_id = p_business_group_id
and p_position_id = assg.position_id
and assg.effective_end_date >= p_start_date
and assg.effective_start_date <= p_end_date;
select distinct assg.assignment_id
from per_all_assignments_f assg
where business_group_id = p_business_group_id
and p_job_id = assg.job_id
and assg.effective_end_date >= p_start_date
and assg.effective_start_date <= p_end_date;
select distinct assg.assignment_id
from per_all_assignments_f assg
where p_organization_id = assg.organization_id
and business_group_id = p_business_group_id
and assg.effective_end_date >= p_start_date
and assg.effective_start_date <= p_end_date;
select distinct assg.assignment_id
from per_all_assignments_f assg
where business_group_id = p_business_group_id
and p_grade_id = assg.grade_id
and assg.effective_end_date >= p_start_date
and assg.effective_start_date <= p_end_date;
select 1
from pqh_bdgt_cmmtmnt_elmnts
where actual_commitment_type in ('ACTUAL','BOTH')
and budget_id = p_budget_id;
Select sum(pc.costed_value)
From
(select distinct assignment_id, payroll_id from per_all_assignments_f assg
where ASSG.effective_end_date >= p_actuals_start_date
and ASSG.effective_start_date <= p_actuals_end_date
AND assg.position_id = p_position_id
-- and assg.assignment_id <> p_ex_assignment_id
) a,
pay_payroll_actions ppa,
PAY_ASSIGNMENT_ACTIONS AAC,
PAY_COSTS pc,
PAY_ELEMENT_TYPES_F PET,
PAY_INPUT_VALUES_F INV,
pqh_bdgt_cmmtmnt_elmnts pbce
Where PPA.PAYROLL_ACTION_ID = AAC.PAYROLL_ACTION_ID
AND PPA.PAYROLL_ID = A.PAYROLL_ID
AND ppa.action_type IN ('Q','R','V','B')
AND ppa.date_earned BETWEEN p_actuals_start_date AND p_actuals_end_date
AND aac.run_type_id IS not NULL
and AAC.ASSIGNMENT_ID = a.assignment_id
and aac.assignment_action_id = pc.assignment_action_id
and pbce.actual_commitment_type in ('ACTUAL','BOTH')
and pbce.budget_id = p_budget_id
and pc.input_value_id = inv.input_value_id
AND PET.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
and pbce.element_type_id = INV.element_type_id
--AND INV.NAME = 'Pay Value'
AND INV.INPUT_VALUE_ID = pbce.element_input_value_id--'Pay Value'
--AND (PET.CLASSIFICATION_ID = p_cl_id_1 or PET.CLASSIFICATION_ID = p_cl_id_2)
AND BALANCE_OR_COST = 'C';
select classification_id
from pay_element_classifications,
hr_all_positions_f pos,
HR_ORGANIZATION_INFORMATION O3
where classification_name in ('Earnings', 'Employer Liabilities')
and legislation_code = O3.ORG_INFORMATION9
and pos.position_id = p_position_id
and p_actuals_start_date between pos.effective_start_date and pos.effective_end_date
and pos.business_group_id = O3.ORGANIZATION_ID
and O3.ORG_INFORMATION_CONTEXT = 'Business Group Information';
Select sum(pc.costed_value)
From
(select distinct assignment_id, payroll_id from per_all_assignments_f assg
where ASSG.effective_end_date >= p_actuals_start_date
and ASSG.effective_start_date <= p_actuals_end_date
AND assg.position_id = p_position_id
-- and assg.assignment_id <> p_ex_assignment_id
) a,
pay_payroll_actions ppa,
PAY_ASSIGNMENT_ACTIONS AAC,
PAY_COSTS pc,
PAY_ELEMENT_TYPES_F PET,
PAY_INPUT_VALUES_F INV
Where PPA.PAYROLL_ACTION_ID = AAC.PAYROLL_ACTION_ID
AND PPA.PAYROLL_ID = A.PAYROLL_ID
AND ppa.action_type IN ('Q','R','V','B')
AND ppa.date_earned BETWEEN p_actuals_start_date AND p_actuals_end_date
AND aac.run_type_id IS not NULL
and AAC.ASSIGNMENT_ID = a.assignment_id
and aac.assignment_action_id = pc.assignment_action_id
and pc.input_value_id = inv.input_value_id
AND PET.ELEMENT_TYPE_ID = INV.ELEMENT_TYPE_ID
AND INV.NAME = 'Pay Value'
AND (PET.CLASSIFICATION_ID = p_cl_id_1 or PET.CLASSIFICATION_ID = p_cl_id_2)
AND BALANCE_OR_COST = 'C';