The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'x'
from dual
where exists (
select null
from per_all_assignments_f asg, per_assignment_status_types ast
where asg.position_id = p_position_id
and asg.assignment_type in ('E', 'C','A') -- changes made for the bug 5680305
and asg.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN'
and ((asg.effective_start_date between p_validation_start_date
and p_validation_end_date) or
(asg.effective_end_date between p_validation_start_date
and p_validation_end_date) or
(asg.effective_start_date <= p_validation_start_date
and effective_end_date >=p_validation_end_date))
);
procedure hr_psf_bus_insert_validate(p_rec in hr_psf_shd.g_rec_type
,p_effective_date in date
) is
l_chk_position_job_grade boolean;
select transaction_status
from pqh_position_transactions
where position_transaction_id = p_position_transaction_id;
procedure hr_psf_bus_update_validate(p_rec in hr_psf_shd.g_rec_type
,p_effective_date in date
,p_validation_start_date in date
,p_validation_end_date in date
,p_datetrack_mode in varchar2
) is
--
--
l_chk_seasonal boolean;
select transaction_status
from pqh_position_transactions
where position_transaction_id = p_position_transaction_id;
select max(pqh_psf_bus.sum_assignment_fte(p_position_id,ed))
from
(select a.effective_start_date ed
from per_all_assignments_f a
where a.position_id = p_position_id
and ((a.effective_start_date between p_validation_start_date and p_validation_end_date)
and ((a.effective_end_date between p_validation_start_date and p_validation_end_date)
))
union
select a.effective_end_date ed
from per_all_assignments_f a
where a.position_id = p_position_id
and ((a.effective_start_date between p_validation_start_date and p_validation_end_date)
and ((a.effective_end_date between p_validation_start_date and p_validation_end_date)
))
union
select p_validation_start_date ed
from dual
union
select p_validation_end_date ed
from dual);
if ((p_datetrack_mode IN ('CORRECTION', 'UPDATE','UPDATE_CHANGE_INSERT',
'UPDATE_OVERRIDE')) AND
('ELIMINATED'=hr_psf_shd.get_availability_status(
p_rec.availability_status_id,p_rec.business_group_id))) then
hr_utility.set_location('AVAILABILITY STATUS : ELIMINATED', 621);
PROCEDURE per_asg_bus_insert_validate(p_rec per_asg_shd.g_rec_type
,p_effective_date in date) IS
l_bgt_lt_abv_fte boolean := false;
select *
from hr_all_positions
where position_id = p_rec.position_id;
select min(effective_start_date)
from per_all_assignments_f
where position_id = p_position_id
and effective_start_date > p_effective_date;
hr_utility.set_location('Insert Validate: Before open Position', 100);
hr_utility.set_location('Insert Validate: After open before fetch Position', 110);
hr_utility.set_location('Insert Validate: After fetch Position', 120);
hr_utility.set_location('Insert Validate: Before Seasonal Validation', 130);
hr_utility.set_location('Insert Validate: Before Assignment Grade', 130);
hr_utility.set_location('Insert Validate: greater than earliest hire date', 130);
hr_utility.set_location('Insert Validate: before proposed date for Layoff', 130);
hr_utility.set_location('Insert Validate: SHARED position has FTE greater than', 130);
hr_utility.set_location('Insert Validate:Check Insert allowed', 130);
hr_utility.set_location('Insert Validate:POOLED', 130);
hr_utility.set_location('Insert Validate:END POOLED', 130);
hr_utility.set_location('Insert Validate:SINGLE-SHARED', 130);
hr_utility.set_location('Insert Validate:OPEN', 130);
hr_utility.set_location('Insert Validate:SINGLE-SHARED', 130);
hr_utility.set_location('per_asg_insert_validate End',400);
PROCEDURE per_asg_bus_update_validate(p_rec per_asg_shd.g_rec_type
,p_effective_date in date
,p_validation_start_date in date
,p_validation_end_date in date
,p_datetrack_mode in varchar2 ) IS
l_bgt_lt_abv_fte boolean := false;
select *
from hr_all_positions
where position_id = p_rec.position_id;
select *
from per_all_assignments
where assignment_id = p_rec.assignment_id;
select min(effective_start_date)
from per_all_assignments_f
where position_id = p_position_id
and effective_start_date > p_effective_date;
hr_utility.set_location('Insert Validate: SHARED position has FTE greater than', 130);
PROCEDURE per_asg_bus_delete_validate(p_rec per_asg_shd.g_rec_type
,p_effective_date in date
,p_validation_start_date in date
,p_validation_end_date in date
,p_datetrack_mode in varchar2 ) IS
l_position_id number;
select effective_start_date, business_group_id
from per_all_assignments_f
where position_id = p_position_id
and effective_start_date between p_validation_start_date and p_validation_end_date
union
select effective_end_date, business_group_id
from per_all_assignments_f
where position_id = p_position_id
and effective_end_date between p_validation_start_date and p_validation_end_date
union
select abv.effective_start_date, abv.business_group_id
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.position_id = p_position_id
and abv.effective_start_date between p_validation_start_date and p_validation_end_date
and asg.effective_start_date between p_validation_start_date and p_validation_end_date
union
select abv.effective_end_date, abv.business_group_id
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.position_id = p_position_id
and abv.effective_end_date between p_validation_start_date and p_validation_end_date
and asg.effective_end_date between p_validation_start_date and p_validation_end_date
union
select effective_start_date, business_group_id
from hr_all_positions_f
where position_id = p_position_id
and effective_start_date between p_validation_start_date and p_validation_end_date;
select position_id
from per_all_assignments_f
where assignment_id = p_assignment_id
and p_effective_date between effective_start_date and effective_end_date;
select overlap_period, fte, organization_id
from hr_all_positions_f
where position_id = p_position_id
and p_date between effective_start_date and effective_end_date;
hr_utility.set_location('Entering pqh_asg_bus_delete_validate', 10);
if p_datetrack_mode in ('DELETE_NEXT_CHANGE', 'FUTURE_CHANGE') then
for r1 in c_changed_dates(l_position_id, p_validation_start_date, p_validation_end_date)
loop
hr_utility.set_location('Effective Start Date : ' || r1.effective_start_date,50);
hr_utility.set_location('Exiting pqh_asg_bus_delete_validate', 400);
PROCEDURE per_abv_insert_validate(
p_assignment_id number,
p_value number,
p_unit varchar2,
p_effective_date date) is
l_proc varchar2(100) := 'per_abv_insert_validate';
select paf.position_id, paf.person_id, paf.business_group_id, paf.assignment_type -- bug 7008697
from per_all_assignments_f paf
where paf.assignment_id = p_assignment_id
and p_effective_date between paf.effective_start_date and paf.effective_end_date;
select position_id, fte, max_persons, position_type, organization_id, overlap_period
from hr_all_positions_f psf
where position_id =
(select position_id
from per_all_assignments_f paf
where paf.assignment_id = p_assignment_id
and p_effective_date between paf.effective_start_date and paf.effective_end_date)
and p_effective_date between psf.effective_start_date and psf.effective_end_date;
select sum(value)
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.position_id = p_position_id
and p_effective_date between asg.effective_start_date and asg.effective_end_date
and p_effective_date between abv.effective_start_date and abv.effective_end_date
and abv.unit in ('F', 'FTE')
and asg.assignment_type in ('E','C'); -- bug 7008697
hr_utility.set_location('Insert Validate:SINGLE-SHARED', 130);
hr_utility.set_location('Insert Validate:OPEN', 130);
PROCEDURE per_abv_update_validate(
p_abv_id number,
p_assignment_id number,
p_value number,
p_unit varchar2,
p_effective_date date,
p_validation_start_date date,
p_validation_end_date date,
p_datetrack_mode varchar2) is
l_proc varchar2(100) := 'per_abv_update_validate';
select position_id, person_id, business_group_id, assignment_type
from per_all_assignments_f paf
where paf.assignment_id = p_assignment_id
and p_effective_date between paf.effective_start_date and paf.effective_end_date;
select position_id, fte, max_persons, position_type, organization_id, overlap_period
from hr_all_positions_f psf
where position_id =
(select position_id
from per_all_assignments_f paf
where paf.assignment_id = p_assignment_id
and p_effective_date between paf.effective_start_date and paf.effective_end_date)
and p_effective_date between psf.effective_start_date and psf.effective_end_date;
select sum(value)
from per_assignment_budget_values_f abv, per_all_assignments_f asg,
per_assignment_status_types ast
where abv.assignment_id = asg.assignment_id
and asg.position_id = p_position_id
and p_effective_date between asg.effective_start_date and asg.effective_end_date
and p_effective_date between abv.effective_start_date and abv.effective_end_date
and abv.unit in ('FTE')
and asg.assignment_id <> nvl(p_assignment_id,-999)
and asg.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN' -- Condition added for Bug 8309035
and asg.assignment_type in ('E','C'); -- bug 7008697
hr_utility.set_location('Insert Validate:SINGLE-SHARED', 130);
hr_utility.set_location('Insert Validate:OPEN', 130);
select sum(nvl(value,1))
from per_assignment_budget_values_f abv, per_all_assignments_f asn,
per_assignment_status_types ast
where abv.assignment_id(+) = asn.assignment_id
and p_effective_date between asn.effective_start_date and asn.effective_end_date
and p_effective_date between abv.effective_start_date and abv.effective_end_date
and asn.position_id = p_position_id
and asn.assignment_type in ('E', 'C')
and abv.unit(+) = 'FTE'
and asn.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN';
select sum(nvl(value,1))
from per_assignment_budget_values_f abv, per_all_assignments_f asn,
per_assignment_status_types ast
where abv.assignment_id(+) = asn.assignment_id
and asn.assignment_id <> p_assignment_id
and p_effective_date between asn.effective_start_date and asn.effective_end_date
and p_effective_date between abv.effective_start_date and abv.effective_end_date
and asn.position_id = p_position_id
and asn.assignment_type in ('E', 'C')
and abv.unit(+) = 'FTE'
and asn.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN';
select nvl(sum(nvl(value,1)),0)
from per_all_assignments_f asn,FND_SESSIONS SS,
per_assignment_budget_values_f abv, FND_SESSIONS SS2,
per_assignment_status_types ast
where abv.assignment_id(+) = asn.assignment_id
and SS.SESSION_ID = USERENV('sessionid')
and asn.EFFECTIVE_START_DATE <= SS.EFFECTIVE_DATE
and asn.EFFECTIVE_END_DATE >= SS.EFFECTIVE_DATE
and SS2.SESSION_ID(+) = USERENV('sessionid')
and abv.EFFECTIVE_START_DATE <= SS2.EFFECTIVE_DATE(+)
and abv.EFFECTIVE_END_DATE >= SS2.EFFECTIVE_DATE(+)
and asn.position_id = p_position_id
and asn.person_id = p_person_id
and asn.assignment_type in ('E', 'C')
and abv.unit(+) = 'FTE'
and asn.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN';
select nvl(sum(nvl(value,1)),0)
from per_all_assignments_f asn,FND_SESSIONS SS,
per_assignment_budget_values_f abv, FND_SESSIONS SS2,
per_assignment_status_types ast
where abv.assignment_id(+) = asn.assignment_id
and SS.SESSION_ID = USERENV('sessionid')
and asn.EFFECTIVE_START_DATE <= SS.EFFECTIVE_DATE
and asn.EFFECTIVE_END_DATE >= SS.EFFECTIVE_DATE
and SS2.SESSION_ID(+) = USERENV('sessionid')
and abv.EFFECTIVE_START_DATE <= SS2.EFFECTIVE_DATE(+)
and abv.EFFECTIVE_END_DATE >= SS2.EFFECTIVE_DATE(+)
and asn.position_id = p_position_id
and asn.person_id = p_person_id
and asn.assignment_id <> p_ex_assignment_id
and asn.assignment_type in ('E', 'C')
and abv.unit(+) = 'FTE'
and asn.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN';
select to_number(org_information2,'99999999.99')
from hr_organization_information
where org_information_context like 'Budget Value Defaults'
and organization_id = p_organization_id
and org_information1='FTE';
select nvl(value,1)
from per_all_assignments_f asn,FND_SESSIONS SS,
per_assignment_budget_values_f abv, FND_SESSIONS SS2
where abv.assignment_id(+) = asn.assignment_id
and SS.SESSION_ID = USERENV('sessionid')
and asn.EFFECTIVE_START_DATE <= SS.EFFECTIVE_DATE
and asn.EFFECTIVE_END_DATE >= SS.EFFECTIVE_DATE
and SS2.SESSION_ID(+) = USERENV('sessionid')
and abv.EFFECTIVE_START_DATE <= SS2.EFFECTIVE_DATE(+)
and abv.EFFECTIVE_END_DATE >= SS2.EFFECTIVE_DATE(+)
and asn.assignment_id = p_assignment_id
and asn.assignment_type in ('E', 'C')
and abv.unit(+) = 'FTE';
select position_transaction_id
from pqh_position_transactions
where position_id = nvl(p_position_id, -1)
and transaction_status in ('SUBMITTED','APPROVED');
select availability_status_id, business_group_id, position_type, date_effective
from hr_all_positions_f
where position_id = p_position_id
and p_effective_date between effective_start_date and effective_end_date;
select overlap_period, overlap_unit_cd
from hr_all_positions
where position_id = p_position_id;
select fnd_date.canonical_to_date(poei_information3), fnd_date.canonical_to_date(poei_information4)
from per_position_extra_info
where information_type = 'PER_OVERLAP'
and position_id = p_position_id;
select fnd_date.canonical_to_date(poei_information3) poei_information3,
nvl(fnd_date.canonical_to_date(poei_information4),
hr_general.end_of_time) poei_information4,
poei_information5, poei_information6, poei_information7
from per_position_extra_info
where position_id = p_position_id
and information_type = 'PER_RESERVED';
select position_type, FTE from hr_all_positions_f
where position_id = p_position_id
and p_effective_date
between effective_start_date and effective_end_date;
select assignment_id
from per_all_assignments_f
where position_id = p_position_id
and p_effective_date
between effective_start_date and effective_end_date
and assignment_type in ('E', 'C');
select poei_information3
from per_position_extra_info
where position_id = p_position_id
and information_type = 'PER_FAMILY'
and poei_information3 in ('ACADEMIC','FACULTY');
select poei_information3
from per_position_extra_info
where position_id = p_rec.position_id
and position_extra_info_id <> l_position_extra_info_id
and information_type = 'PER_FAMILY'
and poei_information3 in ('ACADEMIC','FACULTY');
/*select 'x'
from per_position_extra_info
where p_assignment_start_date
between fnd_date.canonical_to_date(poei_information3)
and fnd_date.canonical_to_date(poei_information4)
-- Start changes for bug 10220040
and p_assignment_end_date
between fnd_date.canonical_to_date(poei_information3)
and fnd_date.canonical_to_date(poei_information4)
-- End changes for bug 10220040
and position_id = p_position_id
and information_type = 'PER_OVERLAP';*/
select
fnd_date.canonical_to_date(poei_information3) effective_start_date,
fnd_date.canonical_to_date(poei_information4) effective_end_date
from (
select poei_information3, poei_information4
from per_position_extra_info
where information_type = 'PER_OVERLAP'
and position_id = p_position_id)
where p_assignment_start_date
between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4), to_date('31/12/4712','dd/mm/rrrr'))
order by 1,2 desc;
select position_type
from hr_all_positions_f
where position_id = p_position_id;
select
paaf.assignment_number,
paaf.effective_start_date,
paaf.effective_end_date
from per_all_assignments_f paaf, per_assignment_status_types past
where paaf.assignment_status_type_id = past.assignment_status_type_id
and paaf.assignment_type in ('E','C') -- Added For Bug#14173834
--and paaf.assignment_type = 'E' -- Commented For Bug#14173834
and past.per_system_status <> 'TERM_ASSIGN'
and paaf.position_id = p_position_id
and paaf.effective_end_date > lp_effective_end_date
and paaf.assignment_id <> nvl(p_assignment_id,-1);
SELECT ASSIGNMENT_TYPE
FROM per_all_assignments_f
WHERE assignment_id = p_assignment_id
AND p_assignment_start_date between effective_start_date and effective_end_date;
select poei_information3,
poei_information4
from per_position_extra_info
where position_id = p_position_id
and information_type = 'PER_SEASONAL';
select 'X'
from hr_all_positions
where position_id = p_position_id
and seasonal_flag = 'Y';
select 'X'
from per_position_extra_info
where position_id = l_position_id
and information_type = 'PER_SEASONAL';
select 'X'
from per_position_extra_info
where position_id = l_position_id
and information_type = 'PER_OVERLAP';
select 'x'
from per_all_assignments
where position_id = p_position_id
and assignment_type in ('E', 'C');
select 'X'
from hr_all_positions
where position_id = p_position_id
and overlap_period is not null;
select count(1)
from per_all_assignments
where position_id = p_position_id
and assignment_type in ('E', 'C');
select count(1)
from per_all_assignments_f paaf, per_assignment_status_types past
where paaf.assignment_status_type_id = past.assignment_status_type_id
and past.per_system_status <> 'TERM_ASSIGN'
and paaf.position_id = p_position_id
and paaf.assignment_type in ('E', 'C')
and p_effective_date between paaf.effective_start_date and paaf.effective_end_date;
select max_persons
from hr_all_positions
where position_id = p_position_id;
select proposed_date_for_layoff
from hr_all_positions_f
where position_id = p_position_id;
select fte/max_persons
from hr_all_positions
where position_id = p_position_id;
select position_type
from hr_all_positions
where position_id = p_position_id;
select entry_grade_id
from hr_all_positions
where position_id = p_position_id;
select work_period_type_cd
from hr_all_positions
where position_id = p_position_id;
select 'x'
from per_valid_grades
where job_id = p_job_id
and grade_id = p_position_grade_id;
select min(effective_start_date)
from per_all_assignments_f
where position_id = p_position_id
and assignment_type in ('E', 'C');
select max(effective_start_date)
from per_all_assignments_f
where position_id = p_position_id
and assignment_type in ('E', 'C');
cursor c1 is select system_type_cd
from per_shared_types
where shared_type_id = p_availability_status_id;
select business_group_id
from hr_all_positions_f
where position_id = p_position_id;
cursor c1(p_unit_id number) is select system_type_cd from
per_shared_types where shared_type_id = p_unit_id;
cursor c2(p_budget_id number) is select bdt.budget_detail_id
from pqh_budget_details bdt,pqh_budget_versions bvr
where bvr.budget_id = p_budget_id
and p_effective_date between bvr.date_from and nvl(bvr.date_to,p_effective_date)
and bdt.budget_version_id = bvr.budget_version_id
and bdt.position_id = p_position_id;
select bpr.budget_unit1_value, bpr.budget_unit2_value, bpr.budget_unit3_value
from pqh_budget_periods bpr, per_time_periods tp_s,
per_time_periods tp_e
where bpr.budget_detail_id = p_budget_detail_id
and tp_s.time_period_id = bpr.start_time_period_id
and tp_e.time_period_id = bpr.end_time_period_id
and tp_s.period_set_name = l_calendar
and tp_e.period_set_name = l_calendar
and p_effective_date between tp_s.start_date and tp_e.end_date;
select budget_id, budget_unit1_id, budget_unit2_id, budget_unit3_id ,period_set_name
into l_budget_id, l_budget_unit1_id, l_budget_unit2_id, l_budget_unit3_id, l_calendar
from pqh_budgets
where position_control_flag = 'Y'
and budgeted_entity_cd = 'POSITION'
and business_group_id = l_business_group_id
and p_effective_date between budget_start_date and budget_end_date
and (
hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'FTE'
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'FTE'
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'FTE'
);
select stp.start_date
from pqh_budget_periods bper,
pqh_budget_details bdet,
per_time_periods stp,
per_time_periods etp
where bper.budget_detail_id = bdet.budget_detail_id
and p_position_id = bdet.position_id
and bper.start_time_period_id = stp.time_period_id
and bper.end_time_period_id = etp.time_period_id
and etp.end_date >= p_start_date
and stp.start_date <= p_end_date
union
select effective_start_date start_date
from per_all_assignments_f
where p_position_id = position_id
and assignment_type in ('E', 'C')
and effective_start_date between p_start_date and p_end_date
union
select abv.effective_start_date start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and p_position_id = asg.position_id
and asg.assignment_type in ('E', 'C')
and abv.unit = 'FTE'
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_start_date and p_end_date;
select stp.start_date
from pqh_budget_periods bper,
pqh_budget_details bdet,
per_time_periods stp,
per_time_periods etp
where bper.budget_detail_id = bdet.budget_detail_id
and p_job_id = bdet.job_id
and bper.start_time_period_id = stp.time_period_id
and bper.end_time_period_id = etp.time_period_id
and etp.end_date >= p_start_date
and stp.start_date <= p_end_date
union
select effective_start_date start_date
from per_all_assignments_f
where p_job_id = job_id
and assignment_type in ('E', 'C')
and effective_start_date between p_start_date and p_end_date
union
select abv.effective_start_date start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and p_job_id = asg.job_id
and asg.assignment_type in ('E', 'C')
and abv.unit = 'FTE'
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_start_date and p_end_date;
select stp.start_date
from pqh_budget_periods bper,
pqh_budget_details bdet,
per_time_periods stp,
per_time_periods etp
where bper.budget_detail_id = bdet.budget_detail_id
and p_organization_id = bdet.organization_id
and bper.start_time_period_id = stp.time_period_id
and bper.end_time_period_id = etp.time_period_id
and etp.end_date >= p_start_date
and stp.start_date <= p_end_date
union
select effective_start_date start_date
from per_all_assignments_f
where p_organization_id = organization_id
and assignment_type in ('E', 'C')
and effective_start_date between p_start_date and p_end_date
union
select abv.effective_start_date start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and p_organization_id = asg.organization_id
and asg.assignment_type in ('E', 'C')
and abv.unit = 'FTE'
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_start_date and p_end_date;
select stp.start_date
from pqh_budget_periods bper,
pqh_budget_details bdet,
per_time_periods stp,
per_time_periods etp
where bper.budget_detail_id = bdet.budget_detail_id
and p_grade_id = bdet.grade_id
and bper.start_time_period_id = stp.time_period_id
and bper.end_time_period_id = etp.time_period_id
and etp.end_date >= p_start_date
and stp.start_date <= p_end_date
union
select effective_start_date start_date
from per_all_assignments_f
where p_grade_id = grade_id
and assignment_type in ('E', 'C')
and effective_start_date between p_start_date and p_end_date
union
select abv.effective_start_date start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and p_grade_id = asg.grade_id
and asg.assignment_type in ('E', 'C')
and abv.unit = 'FTE'
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_start_date and p_end_date;
select system_type_cd
from per_shared_types
where shared_type_id = p_unit_id;
select bdet.budget_detail_id
from pqh_budget_details bdet,pqh_budget_versions bvr
where bvr.budget_id = p_budget_id
and hr_general.effective_date between bvr.date_from and nvl(bvr.date_to,hr_general.effective_date)
and bdet.budget_version_id = bvr.budget_version_id
and nvl(p_organization_id, nvl(bdet.organization_id, -1)) =
nvl(bdet.organization_id, -1)
and nvl(p_job_id, nvl(bdet.job_id, -1)) =
nvl(bdet.job_id, -1)
and nvl(p_position_id, nvl(bdet.position_id, -1)) =
nvl(bdet.position_id, -1)
and nvl(p_grade_id, nvl(bdet.grade_id, -1)) =
nvl(bdet.grade_id, -1);
select bpr.budget_unit1_value, bpr.budget_unit2_value, bpr.budget_unit3_value
from pqh_budget_periods bpr, per_time_periods tp_s,
per_time_periods tp_e
where bpr.budget_detail_id = p_budget_detail_id
and tp_s.time_period_id = bpr.start_time_period_id
and tp_e.time_period_id = bpr.end_time_period_id
and tp_s.period_set_name = l_calendar
and tp_e.period_set_name = l_calendar
and p_effective_date between tp_s.start_date and tp_e.end_date;
select budget_id, budget_unit1_id, budget_unit2_id, budget_unit3_id ,period_set_name
into l_budget_id, l_budget_unit1_id, l_budget_unit2_id, l_budget_unit3_id, l_calendar
from pqh_budgets
where position_control_flag = 'Y'
and budgeted_entity_cd = p_budget_entity
and business_group_id = p_business_group_id
and p_effective_date between budget_start_date and budget_end_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 to_number(poei_information6,'99999999.99') fte
from per_position_extra_info
where p_effective_date
between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time)
and position_id = p_position_id
and information_type= 'PER_RESERVED'
and poei_information5 = p_person_id;
select to_number(pos.poei_information6,'99999999.99') fte
from
(SELECT poei_information6, poei_information3, poei_information4, ROWNUM rn from per_position_extra_info
WHERE position_id = p_position_id
and information_type= 'PER_RESERVED'
and poei_information5 = p_person_id) pos
where p_effective_date between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time);
select sum(to_number(poei_information6,'99999999.99')) fte
from per_position_extra_info
where p_effective_date
between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time)
and position_id = p_position_id
and information_type= 'PER_RESERVED';
select sum(to_number(poei_information6,'99999999.99')) fte
from ( SELECT poei_information6,poei_information3,poei_information4, ROWNUM rn from per_position_extra_info
WHERE position_id = p_position_id
and information_type= 'PER_RESERVED') pos
where p_effective_date between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time);
select poei_information5 person_id
from per_position_extra_info
where p_effective_date
between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time)
and position_id = p_position_id
and poei_information5 is not null
and information_type= 'PER_RESERVED';
select poei_information5 person_id
from ( SELECT poei_information5, poei_information3, poei_information4, ROWNUM rn
FROM per_position_extra_info
WHERE position_id = p_position_id
and poei_information5 is not null
and information_type= 'PER_RESERVED') pos
where p_effective_date between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time);
select nvl(abv.value,0)
from per_assignment_budget_values_f abv, per_all_assignments_f asg,
per_assignment_status_types ast
where asg.assignment_id = p_assignment_id
and abv.assignment_id = asg.assignment_id
and asg.assignment_type in ('E', 'C')
and abv.unit = 'FTE'
and p_effective_date between asg.effective_start_date and asg.effective_end_date
and p_effective_date between abv.effective_start_date and abv.effective_end_date
and asg.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN';
select business_group_id
from hr_all_positions_f
where position_id = p_position_id;
cursor c1(p_unit_id number) is select system_type_cd from
per_shared_types where shared_type_id = p_unit_id;
select bdt.budget_detail_id, bdt.budget_unit1_value, bdt.budget_unit2_value, bdt.budget_unit3_value
from pqh_budget_details bdt,pqh_budget_versions bvr
where bvr.budget_id = p_budget_id
and p_effective_date between bvr.date_from and nvl(bvr.date_to,p_effective_date)
and bdt.budget_version_id = bvr.budget_version_id
and bdt.position_id = p_position_id;
select budget_id, budget_unit1_id, budget_unit2_id, budget_unit3_id ,period_set_name
into l_budget_id, l_budget_unit1_id, l_budget_unit2_id, l_budget_unit3_id, l_calendar
from pqh_budgets
where position_control_flag = 'Y'
and budgeted_entity_cd = 'POSITION'
and business_group_id = l_business_group_id
and p_effective_date between budget_start_date and budget_end_date
and (
hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
);
select business_group_id
from hr_all_positions_f
where position_id = p_position_id;
cursor c1(p_unit_id number) is select system_type_cd from
per_shared_types where shared_type_id = p_unit_id;
select budget_id, budget_unit1_id, budget_unit2_id, budget_unit3_id ,period_set_name
, budget_start_date, budget_end_date
into l_budget_id, l_budget_unit1_id, l_budget_unit2_id, l_budget_unit3_id, l_calendar
,l_start_date, l_end_date
from pqh_budgets
where position_control_flag = 'Y'
and budgeted_entity_cd = 'POSITION'
and business_group_id = l_business_group_id
and p_effective_date between budget_start_date and budget_end_date
and (
hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
);
select budget_version_id into l_budget_version_id
from pqh_budget_versions bvr
where budget_id = l_budget_id
and p_effective_date between bvr.date_from and nvl(bvr.date_to,p_effective_date);
select business_group_id
from per_all_assignments_f
where assignment_id = p_assignment_id
and p_effective_date between effective_start_date and effective_end_date;
cursor c1(p_unit_id number) is select system_type_cd from
per_shared_types where shared_type_id = p_unit_id;
select budget_id, budget_unit1_id, budget_unit2_id, budget_unit3_id ,period_set_name
, budget_start_date, budget_end_date
into l_budget_id, l_budget_unit1_id, l_budget_unit2_id, l_budget_unit3_id, l_calendar
,l_start_date, l_end_date
from pqh_budgets
where position_control_flag = 'Y'
and budgeted_entity_cd = 'POSITION'
and business_group_id = l_business_group_id
and p_effective_date between budget_start_date and budget_end_date
and (
hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit1_id) = 'MONEY'
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit2_id) = 'MONEY'
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(budget_unit3_id) = 'MONEY'
);
select budget_version_id into l_budget_version_id
from pqh_budget_versions bvr
where budget_id = l_budget_id
and p_effective_date between bvr.date_from and nvl(bvr.date_to,p_effective_date);
select sum(poei_information6) fte
from per_position_extra_info
where p_effective_date
between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time)
and position_id = p_position_id
and information_type= 'PER_RESERVED'
and position_extra_info_id <> l_ex_position_extra_info_id;
select sum(poei_information6) fte
from (SELECT poei_information6,poei_information3, poei_information4, ROWNUM rn
FROM per_position_extra_info
WHERE position_id = p_position_id
and information_type= 'PER_RESERVED'
and position_extra_info_id <> l_ex_position_extra_info_id) pei
where p_effective_date between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time);
select poei_information6
from per_position_extra_info
where position_extra_info_id = p_position_extra_info_id;
select sum(nvl(value,0))
from per_all_assignments_f asn,
per_assignment_budget_values_f abv,
per_assignment_status_types ast
where abv.assignment_id = asn.assignment_id
and asn.EFFECTIVE_START_DATE <= p_effective_date
and asn.EFFECTIVE_END_DATE >= p_effective_date
and abv.EFFECTIVE_START_DATE <= p_effective_date
and abv.EFFECTIVE_END_DATE >= p_effective_date
and asn.position_id = p_position_id
and asn.person_id <> l_ex_person_id
and asn.assignment_type in ('E', 'C')
and abv.unit = 'FTE'
and asn.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN'
and not exists (
select null
from (SELECT position_extra_info_id,poei_information3,poei_information4,poei_information5, ROWNUM rn -- changed for 8727415
FROM per_position_extra_info
where information_type= 'PER_RESERVED'
and position_id = p_position_id ) pei
where position_extra_info_id <> l_ex_position_extra_info_id
and fnd_date.canonical_to_date(poei_information3) <= p_effective_date
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time) >= p_effective_date
and poei_information5 = asn.person_id);
select fte
from hr_all_positions_f
where position_id = p_position_id
and p_effective_date between effective_start_date and effective_end_date;
select nvl(sum(nvl(value,1)),0)
from per_assignment_budget_values_f abv, per_all_assignments_f asn,
per_assignment_status_types ast
where abv.assignment_id(+) = asn.assignment_id
and asn.position_id = p_position_id
and asn.person_id = p_person_id
and asn.assignment_id <> nvl(p_ex_assignment_id, -1)
and p_effective_date between asn.effective_start_date and asn.effective_end_date
and p_effective_date between abv.effective_start_date and abv.effective_end_date
and asn.assignment_type in ('E', 'C')
and abv.unit(+) = 'FTE'
and asn.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN';
select abv.effective_start_date effective_date
from per_assignment_budget_values_f abv, per_all_assignments_f asn
where abv.assignment_id = asn.assignment_id
and asn.position_id = p_position_id
and abv.effective_start_date between asn.effective_start_date and asn.effective_end_date
and abv.effective_start_date between
p_start_date and nvl(p_end_date, hr_general.end_of_time)
and asn.effective_start_date between
p_start_date and nvl(p_end_date, hr_general.end_of_time)
and asn.assignment_type in ('E', 'C')
and abv.unit(+) = 'FTE'
union
select effective_start_date effective_date
from per_all_assignments_f asg
where position_id = p_position_id
and asg.effective_start_date between
p_start_date and nvl(p_end_date, hr_general.end_of_time)
union
select effective_start_date effective_date
from hr_all_positions_f psf
where position_id = p_position_id
and psf.effective_start_date between
p_start_date and nvl(p_end_date, hr_general.end_of_time)
union
select p_start_date effective_date
from dual
union
select nvl(p_end_date, hr_general.end_of_time) effective_date
from dual;
select business_group_id
from hr_all_positions_f
where position_id = p_position_id;
select position_type, overlap_period, business_group_id
from hr_all_positions_f
where position_id = p_position_id
and p_effective_date between effective_start_date and effective_end_date;
/*** index hint added in the select statement of the inner
query of the cursor as a fix of bug 5963148 **/
-- Start changes for bug 10262123
cursor c_pos_reserved(p_position_id number, p_effective_date date) is
select 'x'
from (select /*+ INDEX(PER_POSITION_EXTRA_INFO PER_POSITION_EXTRA_INFO_N3)*/
poei_information3,
poei_information4
from per_position_extra_info
where information_type = 'PER_RESERVED'
and position_id = p_position_id)
where p_effective_date
between
fnd_date.canonical_to_date(poei_information3)
and
nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time);
/*** index hint added in the select statement of the inner
query of the cursor as a fix of bug 6409206 **/
cursor c_pos_reserved(p_position_id number,
p_effective_date date) is
select 'x'
from (select /*+ INDEX(PER_POSITION_EXTRA_INFO PER_POSITION_EXTRA_INFO_N3)*/
fnd_date.canonical_to_date(poei_information3) poei_information3,
nvl(fnd_date.canonical_to_date(poei_information4),
hr_general.end_of_time) poei_information4
from per_position_extra_info
where information_type = 'PER_RESERVED'
and position_id = p_position_id)
where p_effective_date <= poei_information4;
select effective_start_date
from per_all_assignments_f
where position_id = p_position_id
and assignment_type in ('E', 'C')
and effective_start_date between p_validation_start_date and p_validation_end_date
union
select abv.effective_start_date effective_start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.position_id = p_position_id
and asg.assignment_type in ('E', 'C')
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_validation_start_date and p_validation_end_date
and asg.business_group_id = abv.business_group_id
union
select effective_start_date
from (select fnd_date.canonical_to_date(poei_information3) effective_start_date
from per_position_extra_info
where position_id = p_position_id
and information_type = 'PER_RESERVED')
where effective_start_date >= p_validation_start_date
union
select effective_start_date
from per_all_assignments_f
where assignment_id = p_assignment_id
and assignment_type in ('E', 'C')
and effective_start_date between p_validation_start_date and p_validation_end_date
union
select abv.effective_start_date effective_start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.assignment_id = p_assignment_id
and asg.assignment_type in ('E', 'C')
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_validation_start_date and p_validation_end_date
union
select effective_start_date
from hr_all_positions_f
where position_id = p_position_id
and effective_start_date between p_validation_start_date and p_validation_end_date;
select effective_start_date
from per_all_assignments_f
where position_id = p_position_id
and assignment_type in ('E', 'C')
and effective_start_date between p_validation_start_date and p_validation_end_date
union
select abv.effective_start_date effective_start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.position_id = p_position_id
and asg.assignment_type in ('E', 'C')
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_validation_start_date and p_validation_end_date
union
select effective_start_date
from (select fnd_date.canonical_to_date(poei_information3) effective_start_date
from per_position_extra_info
where position_id = p_position_id
and information_type = 'PER_RESERVED')
where effective_start_date >= p_validation_start_date
union
select effective_start_date
from hr_all_positions_f
where position_id = p_position_id
and effective_start_date between p_validation_start_date and p_validation_end_date;
select position_type, fte, organization_id, overlap_period, business_group_id
from hr_all_positions_f
where position_id = p_position_id
and p_effective_date between effective_start_date and effective_end_date;
select effective_start_date
from per_all_assignments_f
where position_id = p_position_id
and assignment_type in ('E', 'C')
and effective_start_date between p_validation_start_date and p_validation_end_date
and effective_end_date between p_validation_start_date and p_validation_end_date -- 11059779
union
--11059779
select effective_end_date --effective_start_date changed for bug 12751673
from per_all_assignments_f
where position_id = p_position_id
and assignment_type in ('E', 'C')
and( p_validation_start_date between effective_start_date and effective_end_date
or p_validation_end_date between effective_start_date and effective_end_date)
--11059779
union
select abv.effective_start_date effective_start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.position_id = p_position_id
and asg.assignment_type in ('E', 'C')
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_validation_start_date and p_validation_end_date
and asg.business_group_id = abv.business_group_id
union
select effective_start_date
from per_all_assignments_f
where assignment_id = p_assignment_id
and assignment_type in ('E', 'C')
and effective_start_date between p_validation_start_date and p_validation_end_date
union
select abv.effective_start_date effective_start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.assignment_id = p_assignment_id
and asg.assignment_type in ('E', 'C')
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_validation_start_date and p_validation_end_date
union
select effective_start_date
from hr_all_positions_f
where position_id = p_position_id
and effective_start_date between p_validation_start_date and p_validation_end_date;
select effective_start_date
from per_all_assignments_f
where position_id = p_position_id
and assignment_type in ('E', 'C')
and effective_start_date between p_validation_start_date and p_validation_end_date
union
select abv.effective_start_date effective_start_date
from per_assignment_budget_values_f abv, per_all_assignments_f asg
where abv.assignment_id = asg.assignment_id
and asg.position_id = p_position_id
and asg.assignment_type in ('E', 'C')
and abv.effective_start_date between asg.effective_start_date and asg.effective_end_date
and asg.effective_start_date between p_validation_start_date and p_validation_end_date
and asg.business_group_id = abv.business_group_id
union
select effective_start_date
from hr_all_positions_f
where position_id = p_position_id
and effective_start_date between p_validation_start_date and p_validation_end_date;
select fte, business_group_id
from hr_all_positions_f
where position_id = p_position_id
and p_effective_date
between effective_start_date and effective_end_date;
select sum(to_number(poei_information6,'99999999.99'))
from (SELECT poei_information6,poei_information3, poei_information4,poei_information5, ROWNUM rn -- changed for 8727415
FROM per_position_extra_info
where information_type = 'PER_RESERVED'
and position_id = p_position_id ) poei
Where p_effective_start_date
between fnd_date.canonical_to_date(poei_information3)
and nvl(fnd_date.canonical_to_date(poei_information4),hr_general.end_of_time)
and poei_information5 is null;
select sum(value)
from per_assignment_budget_values_f abv, per_all_assignments_f asn,
per_assignment_status_types ast
where abv.assignment_id(+) = asn.assignment_id
and p_effective_start_date between asn.effective_start_date and asn.effective_end_date
and p_effective_start_date between abv.effective_start_date and abv.effective_end_date
and asn.position_id = p_position_id
and asn.assignment_type in ('E', 'C')
and abv.unit(+) = 'FTE'
and asn.assignment_status_type_id = ast.assignment_status_type_id
and ast.per_system_status <> 'TERM_ASSIGN'
and not exists
( select null
from (SELECT poei_information3, poei_information4, poei_information5, ROWNUM rn -- changed for 8727415
FROM per_position_extra_info
where information_type = 'PER_RESERVED'
and position_id = p_position_id) poei
where p_effective_start_date
between fnd_date.canonical_to_date(poei.poei_information3)
and nvl(fnd_date.canonical_to_date(poei.poei_information4),hr_general.end_of_time)
and to_number(poei.poei_information5) = asn.person_id);
select a.organization_id_parent organization_id
from per_org_structure_elements a
where a.org_structure_version_id = p_pc_version
and not exists
(select null
from per_org_structure_elements b
where b.org_structure_version_id = p_pc_version
AND b.organization_id_child = a.organization_id_parent);
SELECT org_structure_version_id
FROM per_organization_structures pos,
per_org_structure_versions ver
WHERE pos.organization_structure_id = ver.organization_structure_id
AND p_effective_date BETWEEN ver.date_from AND NVL(ver.date_to, p_effective_date)
AND NVL(pos.position_control_structure_flg,'N') = 'Y'
AND pos.business_group_id = p_business_group_id;
select position_id, organization_id
from per_all_assignments_f
where assignment_id = p_assignment_id
and p_effective_date between effective_start_date and effective_end_date;
select bgt.budget_id, bgt.budget_name, bgt.business_group_id,
bver.budget_version_id,
bgt.budget_start_date, bgt.budget_end_date, bgt.currency_code
from pqh_budgets bgt,
pqh_budget_versions bver,
pqh_budget_details bdet
where bgt.budget_id = bver.budget_id
and bver.budget_version_id = bdet.budget_version_id
and bdet.position_id = p_position_id
and p_effective_date between bgt.budget_start_date and bgt.budget_end_date
and p_effective_date between bver.date_from and bver.date_to
and bgt.budgeted_entity_cd = 'POSITION'
and bgt.position_control_flag = 'Y'
and (hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit1_id) = p_budget_unit_cd
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit2_id) = p_budget_unit_cd
or hr_psf_shd.SYSTEM_AVAILABILITY_STATUS(bgt.budget_unit3_id) = p_budget_unit_cd);
select 'x'
from dual
where exists (
select null
from per_pay_proposals
where assignment_id = p_assignment_id
and p_effective_date >= change_date
and approved = 'Y'
);
select piv.element_type_id, ppb.input_value_id
from per_all_assignments_f asg,
per_pay_bases ppb,
pay_input_values_f piv
where assignment_id = p_assignment_id
and asg.pay_basis_id = ppb.pay_basis_id
and ppb.input_value_id = piv.input_value_id
and p_effective_date between asg.effective_start_date and asg.effective_end_date
and p_effective_date between piv.effective_start_date and piv.effective_end_date;
select pettl1.element_name
from pay_element_types_f_tl pettl1
where pettl1.element_type_id = p_element_type_id
and pettl1.language = userenv('LANG');
select pivtl.name
from pay_input_values_f_tl pivtl
where pivtl.input_value_id = p_input_value_id
and pivtl.language = userenv('LANG');
select 'X'
into l_check
from pqh_bdgt_cmmtmnt_elmnts
where budget_id = p_budget_id
and element_type_id = p_element_type_id
and actual_commitment_type in ('COMMITMENT','BOTH');