37: p_31dec in date)
38: is
39: -- scan all employees in the given year
40: select distinct a.person_id
41: from per_assignment_status_types t,
42: per_all_assignments_f a
43: where t.assignment_status_type_id = a.assignment_status_type_id
44: and t.per_system_status in ('ACTIVE_ASSIGN','SUSP_ASSIGN'
45: ,'ACTIVE_CWK','SUSP_CWK_ASG')
54: p_person_id in number)
55: is
56: -- scan all assignments for the given employee
57: select distinct a.assignment_id asg_id
58: from per_assignment_status_types t,
59: per_all_assignments_f a
60: where a.person_id = p_person_id
61: and t.assignment_status_type_id = a.assignment_status_type_id
62: and nvl(t.per_system_status,' ') in ('ACTIVE_ASSIGN','SUSP_ASSIGN'
79: asg.effective_start_date asg_from,
80: asg.effective_end_date asg_to
81: from
82: per_disabilities_f pdf,
83: per_assignment_status_types typ,
84: per_all_assignments_f asg
85: where asg.person_id = pdf.person_id
86: and asg.assignment_type = 'E'
87: and typ.assignment_status_type_id = asg.assignment_status_type_id