The following lines contain the word 'select', 'insert', 'update' or 'delete':
select nvl(add_months(fnd_date.canonical_to_date(HOI.ORG_INFORMATION11),
12*(floor(months_between(p_upload_date,
fnd_date.canonical_to_date(HOI.ORG_INFORMATION11))/12))),
END_OF_TIME)
from per_assignments_f ASS
,hr_organization_information HOI
where ASS.assignment_id = p_assignment_id
and p_upload_date between ASS.effective_start_date
and ASS.effective_end_date
and HOI.organization_id = ASS.business_group_id
and upper(HOI.org_information_context) = 'BUSINESS GROUP INFORMATION';
select nvl(add_months(fnd_date.canonical_to_date(HOI.ORG_INFORMATION11),
3*(floor(months_between(p_upload_date,
fnd_date.canonical_to_date(HOI.ORG_INFORMATION11))/3))),
END_OF_TIME)
from per_assignments_f ASS
,hr_organization_information HOI
where ASS.assignment_id = p_assignment_id
and p_upload_date between ASS.effective_start_date
and ASS.effective_end_date
and HOI.organization_id = ASS.business_group_id
and upper(HOI.org_information_context) = 'BUSINESS GROUP INFORMATION';
select nvl(PTP.start_date, END_OF_TIME)
from per_time_periods PTP
,per_assignments_f ASS
where ASS.assignment_id = p_assignment_id
and p_upload_date between ASS.effective_start_date
and ASS.effective_end_date
and PTP.payroll_id = ASS.payroll_id
and p_upload_date between PTP.start_date
and PTP.end_date;
select nvl(min(ASG.effective_start_date), END_OF_TIME)
from per_assignments_f ASG
where ASG.assignment_id = p_assignment_id
and ASG.effective_start_date <= p_upload_date;
select nvl(greatest(min(ASS.effective_start_date), p_expiry_date),
END_OF_TIME)
from per_assignments_f ASS
where ASS.assignment_id = p_assignment_id
and ASS.effective_start_date <= p_upload_date
and ASS.effective_end_date >= p_expiry_date;
select BT.balance_type_id
from pay_balance_types BT
where BT.balance_type_id = p_balance_type_id
--
-- TAX_UNIT_ID context NB. if the tax unit is used then only those
-- adjustments which are for the same tax unit can be included.
--
and nvl(p_tax_unit_id, nvl(p_bal_adj_tax_unit_id, -1)) =
nvl(p_bal_adj_tax_unit_id, -1)
--
-- ORIGINAL_ENTRY_ID context NB. this context controls the expiry
-- date of the dimension in the same way as the QTD dimension. Any
-- existing balance adjustments that lie between the upload date
-- and the expiry date are all included. There is no special
-- criteria that has to be met.
--
and 1 = 1;
select htuv.tax_unit_id
from pay_balance_batch_lines pbbl
,hr_tax_units_v htuv
where pbbl.batch_line_id = p_batch_line_id
and pbbl.tax_unit_id = htuv.tax_unit_id
and pbbl.tax_unit_id is not null
union all
select htuv.tax_unit_id
from pay_balance_batch_lines pbbl
,hr_tax_units_v htuv
where pbbl.batch_line_id = p_batch_line_id
and upper(pbbl.gre_name) = upper(htuv.name)
and pbbl.tax_unit_id is null;
select tax_unit_id
,original_entry_id
from pay_temp_balance_adjustments
where batch_line_id = p_test_batch_line_id;