PROCEDURE update_emp_asg
(p_validate IN BOOLEAN DEFAULT FALSE
,p_effective_date IN DATE
,p_datetrack_update_mode IN VARCHAR2
,p_assignment_id IN NUMBER
,p_object_version_number IN OUT NUMBER
,p_supervisor_id IN NUMBER DEFAULT hr_api.g_number
,p_assignment_number IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_change_reason IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_comments IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_date_probation_end IN DATE DEFAULT hr_api.g_date
,p_default_code_comb_id IN NUMBER DEFAULT hr_api.g_number
,p_frequency IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_internal_address_line IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_manager_flag IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_normal_hours IN NUMBER DEFAULT hr_api.g_number
,p_perf_review_period IN NUMBER DEFAULT hr_api.g_number
,p_perf_review_period_frequency IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_probation_period IN NUMBER DEFAULT hr_api.g_number
,p_probation_unit IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_sal_review_period IN NUMBER DEFAULT hr_api.g_number
,p_sal_review_period_frequency IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_set_of_books_id IN NUMBER DEFAULT hr_api.g_number
,p_source_type IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_time_normal_finish IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_time_normal_start IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_bargaining_unit_code IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_labour_union_member_flag IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_hourly_salaried_code IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute_category IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute1 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute2 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute3 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute4 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute5 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute6 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute7 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute8 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute9 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute10 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute11 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute12 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute13 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute14 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute15 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute16 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute17 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute18 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute19 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute20 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute21 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute22 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute23 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute24 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute25 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute26 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute27 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute28 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute29 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_ass_attribute30 IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_title IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_tax_unit IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_timecard_approver IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_timecard_required IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_work_schedule IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_shift IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_spouse_salary IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_legal_representative IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_wc_override_code IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_eeo_1_establishment IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_comment_id OUT NUMBER
,p_soft_coding_keyflex_id OUT NUMBER
,p_effective_start_date OUT DATE
,p_effective_end_date OUT DATE
,p_concatenated_segments OUT VARCHAR2
,p_concat_segments IN VARCHAR2 DEFAULT hr_api.g_varchar2
,p_no_managers_warning OUT BOOLEAN
,p_other_manager_warning OUT BOOLEAN
)
IS
-- Declare cursors and local variables
l_proc VARCHAR2(72) := g_package||'update_emp_asg';
l_effective_date DATE;
l_legislation_code per_business_groups.legislation_code%TYPE;
CURSOR check_legislation
(c_assignment_id per_assignments_f.assignment_id%TYPE,
c_effective_date DATE
)
IS
SELECT bgp.legislation_code
FROM per_assignments_f asg
,per_business_groups bgp
WHERE asg.business_group_id = bgp.business_group_id
AND asg.assignment_id = c_assignment_id
AND c_effective_date BETWEEN effective_start_date AND effective_end_date;
--
BEGIN
-- Truncate date variables
l_effective_date := TRUNC(p_effective_date);
OPEN check_legislation(p_assignment_id, l_effective_date);
FETCH check_legislation INTO l_legislation_code;
IF check_legislation%NOTFOUND THEN
CLOSE check_legislation;
--Print Error Message here
END IF;
CLOSE check_legislation;
-- Check that the legislation of the specified business group is 'US'.
IF l_legislation_code <> 'US' THEN
--Print Error Message here
END IF;
-- Call update_emp_asg business process
hr_assignment_api.update_emp_asg
(p_validate => p_validate
,p_effective_date => p_effective_date
,p_datetrack_update_mode => p_datetrack_update_mode
,p_assignment_id => p_assignment_id
,p_object_version_number => p_object_version_number
,p_supervisor_id => p_supervisor_id
,p_assignment_number => p_assignment_number
,p_change_reason => p_change_reason
,p_comments => p_comments
,p_date_probation_end => p_date_probation_end
,p_default_code_comb_id => p_default_code_comb_id
,p_frequency => p_frequency
,p_internal_address_line => p_internal_address_line
,p_manager_flag => p_manager_flag
,p_normal_hours => p_normal_hours
,p_perf_review_period => p_perf_review_period
,p_perf_review_period_frequency => p_perf_review_period_frequency
,p_probation_period => p_probation_period
,p_probation_unit => p_probation_unit
,p_sal_review_period => p_sal_review_period
,p_sal_review_period_frequency => p_sal_review_period_frequency
,p_set_of_books_id => p_set_of_books_id
,p_source_type => p_source_type
,p_time_normal_finish => p_time_normal_finish
,p_time_normal_start => p_time_normal_start
,p_bargaining_unit_code => p_bargaining_unit_code
,p_labour_union_member_flag => p_labour_union_member_flag
,p_hourly_salaried_code => p_hourly_salaried_code
,p_ass_attribute_category => p_ass_attribute_category
,p_ass_attribute1 => p_ass_attribute1
,p_ass_attribute2 => p_ass_attribute2
,p_ass_attribute3 => p_ass_attribute3
,p_ass_attribute4 => p_ass_attribute4
,p_ass_attribute5 => p_ass_attribute5
,p_ass_attribute6 => p_ass_attribute6
,p_ass_attribute7 => p_ass_attribute7
,p_ass_attribute8 => p_ass_attribute8
,p_ass_attribute9 => p_ass_attribute9
,p_ass_attribute10 => p_ass_attribute10
,p_ass_attribute11 => p_ass_attribute11
,p_ass_attribute12 => p_ass_attribute12
,p_ass_attribute13 => p_ass_attribute13
,p_ass_attribute14 => p_ass_attribute14
,p_ass_attribute15 => p_ass_attribute15
,p_ass_attribute16 => p_ass_attribute16
,p_ass_attribute17 => p_ass_attribute17
,p_ass_attribute18 => p_ass_attribute18
,p_ass_attribute19 => p_ass_attribute19
,p_ass_attribute20 => p_ass_attribute20
,p_ass_attribute21 => p_ass_attribute21
,p_ass_attribute22 => p_ass_attribute22
,p_ass_attribute23 => p_ass_attribute23
,p_ass_attribute24 => p_ass_attribute24
,p_ass_attribute25 => p_ass_attribute25
,p_ass_attribute26 => p_ass_attribute26
,p_ass_attribute27 => p_ass_attribute27
,p_ass_attribute28 => p_ass_attribute28
,p_ass_attribute29 => p_ass_attribute29
,p_ass_attribute30 => p_ass_attribute30
,p_title => p_title
,p_segment1 => p_tax_unit
,p_segment2 => p_timecard_approver
,p_segment3 => p_timecard_required
,p_segment4 => p_work_schedule
,p_segment5 => p_shift
,p_segment6 => p_spouse_salary
,p_segment7 => p_legal_representative
,p_segment8 => p_wc_override_code
,p_segment9 => p_eeo_1_establishment
,p_soft_coding_keyflex_id => p_soft_coding_keyflex_id
,p_comment_id => p_comment_id
,p_effective_start_date => p_effective_start_date
,p_effective_end_date => p_effective_end_date
,p_concatenated_segments => p_concatenated_segments
,p_concat_segments => p_concat_segments
,p_no_managers_warning => p_no_managers_warning
,p_other_manager_warning => p_other_manager_warning
);
END update_emp_asg;