The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
date_earned, payroll_id
into
l_owner_date_earned, l_owner_payroll_id
from
pay_payroll_actions
where
payroll_action_id = p_owner_payroll_action_id;
select
date_earned, payroll_id
into
l_user_date_earned, l_user_payroll_id
from
pay_payroll_actions
where
payroll_action_id = p_user_payroll_action_id;
select
prd_information1
into
l_owner_tax_year
from
per_time_periods
where
payroll_id = l_owner_payroll_id
and
l_owner_date_earned between start_date and end_date;
select
prd_information1
into
l_user_tax_year
from
per_time_periods
where
payroll_id = l_user_payroll_id
and
l_user_date_earned between start_date and end_date;
select rule_mode
into l_tax_start_day
from pay_legislation_rules
where legislation_code = 'ZA'
and rule_type = 'L';
select to_char(p_owner_effective_date,'YYYY')
into l_tax_year
from dual;
SELECT to_date(l_tax_start_day||'-'||l_tax_year,'DD/MM/YYYY')
INTO l_tax_year_start_date
FROM dual;
SELECT (add_months(l_tax_year_start_date,
(floor(months_between(p_owner_effective_date, l_tax_year_start_date) / 12) + 1) * 12) -1)
INTO p_expiry_information
from dual;
select
date_earned, payroll_id
into
l_owner_date_earned, l_owner_payroll_id
from
pay_payroll_actions
where
payroll_action_id = p_owner_payroll_action_id;
select
date_earned, payroll_id
into
l_user_date_earned, l_user_payroll_id
from
pay_payroll_actions
where
payroll_action_id = p_user_payroll_action_id;
select
prd_information3
into
l_owner_cal_year
from
per_time_periods
where
payroll_id = l_owner_payroll_id
and
l_owner_date_earned between start_date and end_date;
select
prd_information3
into
l_user_cal_year
from
per_time_periods
where
payroll_id = l_user_payroll_id
and
l_user_date_earned between start_date and end_date;
SELECT (trunc(add_months(p_owner_effective_date,12),'Y')-1)
INTO p_expiry_information
from dual;
select
date_earned, payroll_id
into
l_owner_date_earned, l_owner_payroll_id
from
pay_payroll_actions
where
payroll_action_id = p_owner_payroll_action_id;
select
date_earned, payroll_id
into
l_user_date_earned, l_user_payroll_id
from
pay_payroll_actions
where
payroll_action_id = p_user_payroll_action_id;
select
prd_information1, prd_information2
into
l_owner_tax_year, l_owner_tax_quarter
from
per_time_periods
where
payroll_id = l_owner_payroll_id
and
l_owner_date_earned between start_date and end_date;
select
prd_information1, prd_information2
into
l_user_tax_year, l_user_tax_quarter
from
per_time_periods
where
payroll_id = l_user_payroll_id
and
l_user_date_earned between start_date and end_date;
select rule_mode
into l_tax_start_day
from pay_legislation_rules
where legislation_code = 'ZA'
and rule_type = 'L';
select to_char(p_owner_effective_date,'YYYY')
into l_tax_year
from dual;
SELECT to_date(l_tax_start_day||'-'||l_tax_year,'DD/MM/YYYY')
INTO l_tax_year_start_date
FROM dual;
SELECT (add_months(l_tax_year_start_date,
(floor(months_between(p_owner_effective_date, l_tax_year_start_date) / 3) + 1) * 3) -1 )
INTO p_expiry_information
FROM dual;
select
date_earned, payroll_id
into
l_owner_date_earned, l_owner_payroll_id
from
pay_payroll_actions
where
payroll_action_id = p_owner_payroll_action_id;
select
date_earned, payroll_id
into
l_user_date_earned, l_user_payroll_id
from
pay_payroll_actions
where
payroll_action_id = p_user_payroll_action_id;
select
pay_advice_date
into
l_owner_month
from
per_time_periods
where
payroll_id = l_owner_payroll_id
and
l_owner_date_earned between start_date and end_date;
select
pay_advice_date
into
l_user_month
from
per_time_periods
where
payroll_id = l_user_payroll_id
and
l_user_date_earned between start_date and end_date;
SELECT ((trunc(add_months(p_owner_effective_date,1),'MM'))-1)
INTO p_expiry_information
FROM dual;
select
time_period_id
into
l_owner_time_period_id
from
pay_payroll_actions
where
payroll_action_id = p_owner_payroll_action_id;
select
time_period_id
into
l_user_time_period_id
from
pay_payroll_actions
where
payroll_action_id = p_user_payroll_action_id;
SELECT ptp.end_date
INTO p_expiry_information
FROM per_time_periods ptp
,pay_payroll_actions ppa
WHERE ppa.payroll_action_id = p_owner_payroll_action_id
AND ppa.payroll_id = ptp.payroll_id
AND p_owner_effective_date BETWEEN ptp.start_date AND ptp.end_date;