The following lines contain the word 'select', 'insert', 'update' or 'delete':
procedure insert_bf_dimensions is
x number;
procedure my_dimension_insert ( p_route_id number,
p_payments_flag varchar2,
p_database_item_suffix varchar2,
p_dimension_name varchar2,
p_dimension_type varchar2,
p_description varchar2,
p_feed_checking_type varchar2,
p_feed_checking_code varchar2,
p_expiry_checking_level varchar2,
p_expiry_checking_code varchar2) is
begin
hr_utility.trace('p_dimension_name is ' || p_dimension_name);
end my_dimension_insert;
function do_child_inserts return number is
x number;
hr_utility.set_location('pay_autogn.insert_bf_dimensions',20);
insert into ff_route_context_usages
(route_id,
context_id,
sequence_no)
select ff_routes_s.currval,
CON.context_id,
1
from ff_contexts CON
where CON.context_name = 'ASSIGNMENT_ACTION_ID';
hr_utility.set_location('pay_autogn.insert_bf_dimensions',30);
insert into ff_route_parameters
(route_parameter_id,
route_id,
sequence_no,
parameter_name,
data_type)
values
(ff_route_parameters_s.nextval,
ff_routes_s.currval,
1,
'Balance Type ID',
'N');
hr_utility.set_location('pay_autogn.insert_bf_dimensions',40);
select ff_routes_s.currval into x from dual;
end do_child_inserts;
hr_utility.set_location('pay_autogn.insert_bf_dimensions',1);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Person-level Tax Year to Date Balance Dimension',
'Summed data for the PERSON-LEVEL BF TAX YEAR TO DATE balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
,per_assignments_f ASS
,per_assignments_f START_ASS
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and PACT.effective_date >=
(select to_date(''06-04-'' || to_char( fnd_number.canonical_to_number(
to_char( BACT.effective_date,''YYYY''))
+ decode(sign( BACT.effective_date - to_date(''06-04-''
|| to_char(BACT.effective_date,''YYYY''),''DD-MM-YYYY'')),
-1,-1,0)),''DD-MM-YYYY'')
from dual)
and ASSACT.action_sequence <= BAL_ASSACT.action_sequence
and START_ASS.assignment_id = BAL_ASSACT.assignment_id
and ASS.period_of_service_id = START_ASS.period_of_service_id
and ASSACT.assignment_id = ASS.assignment_id
and BACT.effective_date between
ASS.effective_start_date and ASS.effective_end_date
and PACT.effective_date between
START_ASS.effective_start_date and START_ASS.effective_end_date');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_YTD',
'Person-level BF Tax Year to Date',
'P',
'Summed data for all a person''s assignments in the BF tax year',
null, -- feed checking type (always feed)
null, -- always feed
'P', -- expiry check at payroll action level
'pay_bf_expc.pytd_ec' -- expry checking procedure.
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',2);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Assignment-level Tax Year to Date Balance Dimension',
'Summed data for the ASSIGNMENT-LEVEL BF TAX YEAR TO DATE balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and PACT.effective_date >=
(select to_date(''06-04-'' || to_char( fnd_number.canonical_to_number(
to_char( BACT.effective_date,''YYYY''))
+ decode(sign( BACT.effective_date - to_date(''06-04-''
|| to_char(BACT.effective_date,''YYYY''),''DD-MM-YYYY'')),
-1,-1,0)),''DD-MM-YYYY'')
from dual)
and ASSACT.action_sequence <= BAL_ASSACT.action_sequence
and ASSACT.assignment_id = BAL_ASSACT.assignment_id');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_AYTD',
'Assignment-level BF Tax Year to Date',
'A',
'Summed data for a single assignment in the BF tax year',
null, -- always feed (no checking type)
null, -- always feed (no code)
'P',
'pay_bf_expc.aytd_ec' -- checking code.
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',3);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Person-level Period to Date Balance Dimension',
'Summed data for the PERSON-LEVEL PERIOD TO DATE balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
,per_assignments_f ASS
,per_assignments_f START_ASS
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and PACT.effective_date >=
(select PTP.start_date from per_time_periods PTP
where BACT.effective_date
between PTP.start_date and PTP.end_date
and PTP.payroll_id = PACT.payroll_id
)
and ASSACT.action_sequence <= BAL_ASSACT.action_sequence
and START_ASS.assignment_id = BAL_ASSACT.assignment_id
and ASS.period_of_service_id = START_ASS.period_of_service_id
and ASSACT.assignment_id = ASS.assignment_id
and BACT.effective_date between
ASS.effective_start_date and ASS.effective_end_date
and PACT.effective_date between
START_ASS.effective_start_date and START_ASS.effective_end_date');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_PTD',
'Person-level Period to Date',
'P',
'Summed data for all a person''s assignments in the current earnings period',
null, -- always feed
null, -- always feed
'P', -- expiry check at Payroll Action level
'pay_bf_expc.pptd_ec' -- expiry checking procedure.
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',5);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Assignment-level Period to Date Balance Dimension',
'Summed data for the ASSIGNMENT-LEVEL PERIOD TO DATE balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and PACT.effective_date >=
(select PTP.start_date from per_time_periods PTP
where BACT.effective_date
between PTP.start_date and PTP.end_date
and PTP.payroll_id = PACT.payroll_id
)
and ASSACT.action_sequence <= BAL_ASSACT.action_sequence
and ASSACT.assignment_id = BAL_ASSACT.assignment_id');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_APTD',
'Assignment-level Period to Date',
'A',
'Summed data for a single assignment in the current earnings period',
null, -- always feed
null, -- always feed
'P', -- expiry check at Payroll Action level
'pay_bf_expc.aptd_ec' -- expiry checking procedure.
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',4);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Person-level Period to Date Balance Dimension (test)',
'Summed data for the PERSON-LEVEL PERIOD TO DATE balance dimension (test)',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
,per_assignments_f ASS
,per_assignments_f START_ASS
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and PACT.effective_date >=
(select PTP.start_date from per_time_periods PTP
where BACT.effective_date
between PTP.start_date and PTP.end_date
and PTP.payroll_id = PACT.payroll_id
)
and ASSACT.action_sequence <= BAL_ASSACT.action_sequence
and START_ASS.assignment_id = BAL_ASSACT.assignment_id
and ASS.period_of_service_id = START_ASS.period_of_service_id
and ASSACT.assignment_id = ASS.assignment_id
and BACT.effective_date between
ASS.effective_start_date and ASS.effective_end_date
and PACT.effective_date between
START_ASS.effective_start_date and START_ASS.effective_end_date');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_TSTPTD',
'Person-level Period to Date (test)',
'P',
'Summed data for all a person''s assignments in the current earnings period',
null, -- always feed
null, -- always feed
'A', -- expiry check at Assignment Action level
'pay_bf_expc.pptd_alc_ec'
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',6);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Person-level User Cleared Balance Dimension',
'Summed data for the PERSON-LEVEL USER CLEARED balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
,per_assignments_f ASS
,per_assignments_f START_ASS
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and ASSACT.action_sequence <= BAL_ASSACT.action_sequence
and START_ASS.assignment_id = BAL_ASSACT.assignment_id
and ASS.period_of_service_id = START_ASS.period_of_service_id
and ASSACT.assignment_id = ASS.assignment_id
and BACT.effective_date between
ASS.effective_start_date and ASS.effective_end_date
and PACT.effective_date between
START_ASS.effective_start_date and START_ASS.effective_end_date');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_USER',
'Person-level User Cleared',
'P',
'Summed data for all a person''s assignments since last cleared down',
null, -- always feed
null, -- always feed
'P', -- expiry check at payroll action level.
'pay_bf_expc.never_expires'
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',7);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Assignment-level User Cleared Balance Dimension',
'Summed data for the ASSIGNMENT-LEVEL USER CLEARED balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and ASSACT.action_sequence <= BAL_ASSACT.action_sequence
and ASSACT.assignment_id = BAL_ASSACT.assignment_id');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_AUSER',
'Assignment-level User Cleared',
'P',
'Summed data for a single assignment since last cleared down',
null, -- always feed
null, -- always feed
'P', -- expiry check at Payroll Action level
'pay_bf_expc.never_expires'
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',8);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Assignment-level User Cleared Balance Dimension (not fed)',
'Summed data for the ASSIGNMENT-LEVEL USER balance dimension (not fed)',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and ASSACT.action_sequence <= BAL_ASSACT.action_sequence
and ASSACT.assignment_id = BAL_ASSACT.assignment_id');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_ANOTFEDUSER',
'Assignment-level User Cleared (not fed)',
'N',
'Summed data for a single assignment since last cleared down (not fed)',
null, -- never fed or stored
null, -- never fed or stored
null, -- never fed or stored
null -- never fed or stored
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',9);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Assignment-level Current Run Balance Dimension',
'Summed data for the ASSIGNMENT-LEVEL CURRENT RUN balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
where ASSACT.assignment_action_id = &B1
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_RUN',
'Assignment-level Current Run',
'F',
'Summed data for an assignment within a run',
null, -- always feed
null, -- always feed
null, -- never stored, no expiry details needed
null -- never stored, no expiry details needed
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',10);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Person-level Contracted In YTD Balance Dimension',
'Summed data for the PERSON-LEVEL CONTRACTED IN YTD balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
,per_assignments_f ASS
,per_assignments_f START_ASS
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and START_ASS.assignment_id = BAL_ASSACT.assignment_id
and ASS.period_of_service_id = START_ASS.period_of_service_id
and ASSACT.assignment_id = ASS.assignment_id
and nvl(ASS.ass_attribute1, ''CO'') = ''CI''
and BACT.effective_date between
ASS.effective_start_date and ASS.effective_end_date
and PACT.effective_date between
START_ASS.effective_start_date and START_ASS.effective_end_date');
x := do_child_inserts;
my_dimension_insert(x,
'N',
'_CI_YTD',
'Person-level Contracted In YTD',
'P',
'Summed data for all a person''s contracted-in assignments (in BF tax year)',
'P', -- we must always feed check.
'pay_bf_expc.pcon_fc', -- feed checking procedure.
'P', -- expiry check at payroll action level.
'pay_bf_expc.pcon_ec' -- expiry checking procedure.
);
hr_utility.set_location('pay_autogn.insert_bf_dimensions',11);
insert into ff_routes
(route_id,
user_defined_flag,
route_name,
description,
text)
values
(ff_routes_s.nextval,
'N',
'BF Payments Balance Dimension',
'Summed data for the PAYMENTS balance dimension',
' pay_balance_feeds_f FEED
,pay_run_result_values TARGET
,pay_run_results RR
,pay_payroll_actions PACT
,pay_assignment_actions ASSACT
,pay_action_interlocks INTLK
,pay_payroll_actions BACT
,pay_assignment_actions BAL_ASSACT
where BAL_ASSACT.assignment_action_id = &B1
and BAL_ASSACT.payroll_action_id = BACT.payroll_action_id
and FEED.balance_type_id = &U1
and FEED.input_value_id = TARGET.input_value_id
and TARGET.run_result_id = RR.run_result_id
and RR.assignment_action_id = ASSACT.assignment_action_id
and ASSACT.payroll_action_id = PACT.payroll_action_id
and PACT.effective_date between
FEED.effective_start_date and FEED.effective_end_date
and RR.status in (''P'',''PA'')
and ASSACT.assignment_action_id = INTLK.locked_action_id
and INTLK.locking_action_id = BAL_ASSACT.assignment_action_id
and ASSACT.assignment_id = BAL_ASSACT.assignment_id');
x := do_child_inserts;
my_dimension_insert(x,
'Y',
'_PAYMENTS',
'Payments',
'N',
'Summed data for all an assignments runs being handled within a payment run',
null, -- never held or stored
null, -- never held or stored
null, -- never held or stored
null -- never held or stored
);
end insert_bf_dimensions;