The following lines contain the word 'select', 'insert', 'update' or 'delete':
CURSOR C1 IS SELECT shift_sequence_number,shift_id,(shift_end_date - shift_start_date ) duration
FROM JTF_CAL_SHIFT_ASSIGN
WHERE calendar_id = p_calendar_id;
CURSOR C2 IS SELECT unit_of_time_value,round(SUM(end_time - begin_time)*24, 2) day_hours
FROM JTF_CAL_SHIFT_CONSTRUCTS
WHERE shift_id = l_t_shift_id
GROUP BY unit_of_time_value;
CURSOR C1 IS SELECT calexp.exception_id, trunc(calexp.start_date_time) start_date_time,
trunc(calexp.end_date_time) end_date_time,calexp.exception_category
FROM JTF_CAL_EXCEPTIONS_B CALEXP, JTF_CAL_EXCEPTION_ASSIGN CALASN
WHERE calasn.calendar_id = p_calendar_id
AND calasn.exception_id = calexp.exception_id;
SELECT start_date_active ,NVL(end_date_active,TO_DATE('01/01/2050','DD/MM/YYYY'))
INTO l_t_start_date,l_t_end_date
FROM JTF_CALENDARS_B
WHERE calendar_id = p_calendar_id;
l_out_sch_record_tab.delete;
PA_SCHEDULE_UTILS.update_sch_rec_tab(px_sch_record_tab =>l_temp_exp_sch_record_tab,
p_start_date => p_cal_except_record_tab(l_I).except_start_date+i
,p_end_date =>p_cal_except_record_tab(l_I).except_start_date+i,p_monday_hours =>0,p_tuesday_hours =>0,
p_wednesday_hours =>0,p_thursday_hours =>0,p_friday_hours =>0,p_saturday_hours =>0,p_sunday_hours =>0,
x_return_status =>l_x_return_status,x_msg_count =>x_msg_count,x_msg_data =>x_msg_data);
PA_SCHEDULE_UTILS.update_sch_rec_tab(px_sch_record_tab =>l_temp_exp_sch_record_tab,
p_start_date => p_cal_except_record_tab(l_I).except_start_date+i
,p_end_date =>p_cal_except_record_tab(l_I).except_start_date+i,p_monday_hours =>0,p_tuesday_hours =>0,
p_wednesday_hours =>0,p_thursday_hours =>0,p_friday_hours =>0,p_saturday_hours =>0,
p_sunday_hours =>0,x_return_status =>l_x_return_status,x_msg_count =>x_msg_count,
x_msg_data =>x_msg_data);
PA_SCHEDULE_UTILS.update_sch_rec_tab(px_sch_record_tab =>l_temp_sch_record_tab,
p_start_date =>p_cal_except_record_tab(l_I).except_start_date+i + 1 ,
p_end_date =>x_sch_record_tab(l_J).end_date,x_return_status =>l_x_return_status,
x_msg_count =>x_msg_count,x_msg_data =>x_msg_data);
PA_SCHEDULE_UTILS.update_sch_rec_tab(px_sch_record_tab =>l_temp_sch_record_tab,
p_start_date =>x_sch_record_tab(l_J).start_date ,
p_end_date =>p_cal_except_record_tab(l_I).except_start_date+i - 1,
x_return_status =>l_x_return_status,x_msg_count =>x_msg_count,x_msg_data =>x_msg_data);
PA_SCHEDULE_UTILS.update_sch_rec_tab(px_sch_record_tab =>l_temp_exp_sch_record_tab,
p_start_date => p_cal_except_record_tab(l_I). except_start_date+i
,p_end_date =>p_cal_except_record_tab(l_I).except_start_date+i,p_monday_hours =>0,p_tuesday_hours =>0,
p_wednesday_hours =>0,p_thursday_hours =>0,p_friday_hours =>0,p_saturday_hours =>0,
p_sunday_hours =>0,x_return_status =>l_x_return_status,x_msg_count =>x_msg_count,
x_msg_data =>x_msg_data);
PA_SCHEDULE_UTILS.update_sch_rec_tab(px_sch_record_tab =>l_temp_sch_record_tab,
p_start_date =>p_cal_except_record_tab(l_I).except_start_date+i + 1 ,
p_end_date =>x_sch_record_tab(l_J).end_date,
x_return_status =>l_x_return_status,x_msg_count =>x_msg_count,x_msg_data =>x_msg_data);
PA_SCHEDULE_UTILS.update_sch_rec_tab(px_sch_record_tab =>l_temp_sch_record_tab,
p_start_date =>x_sch_record_tab(l_J).start_date ,
p_end_date =>p_cal_except_record_tab(l_I).except_start_date+i - 1,
x_return_status =>l_x_return_status,x_msg_count =>x_msg_count,x_msg_data =>x_msg_data);
PA_SCHEDULE_UTILS.update_sch_rec_tab(px_sch_record_tab =>l_temp_exp_sch_record_tab,
p_start_date => p_cal_except_record_tab(l_I). except_start_date+i
,p_end_date =>p_cal_except_record_tab(l_I).except_start_date+i,p_monday_hours =>0,p_tuesday_hours =>0,
p_wednesday_hours =>0,p_thursday_hours =>0,p_friday_hours =>0,p_saturday_hours =>0,
p_sunday_hours =>0,x_return_status =>l_x_return_status,x_msg_count =>x_msg_count,
x_msg_data =>x_msg_data);
l_out_sch_record_tab.delete;
SELECT calendar_id
FROM jtf_calendars_vl
WHERE calendar_name = p_calendar_name;
SELECT calendar_id
INTO x_calendar_id
FROM jtf_calendars_b -- 4370086: FROM jtf_calendars_vl
WHERE calendar_id = p_calendar_id;
SELECT calendar_id
INTO x_calendar_id
FROM jtf_calendars_vl
WHERE calendar_name = p_calendar_name;