create table xx_gosi_update
( emp_no varchar2(240)
,gosi varchar2(240)
,status varchar2(240)
)
Below is the script for update the assignment (I am updating annuities field)
======================================================================
DECLARE
-- Local Variables
-- -----------------------
lc_dt_ud_mode VARCHAR2(100) := NULL;
ln_assignment_id NUMBER := 1336;
ln_supervisor_id NUMBER := 2;
ln_object_number NUMBER := 5;
ln_people_group_id NUMBER :=null; -- 1;
p_effective_date date;
p_object_version_number number;
v_assignment_id number;
-- Out Variables for Find Date Track Mode API
-- -----------------------------------------------------------------
lb_correction BOOLEAN;
lb_update BOOLEAN;
lb_update_override BOOLEAN;
lb_update_change_insert BOOLEAN;
-- Out Variables for Update Employee Assignment API
-- ----------------------------------------------------------------------------
ln_soft_coding_keyflex_id HR_SOFT_CODING_KEYFLEX.SOFT_CODING_KEYFLEX_ID%TYPE;
lc_concatenated_segments VARCHAR2(2000);
ln_comment_id PER_ALL_ASSIGNMENTS_F.COMMENT_ID%TYPE;
lb_no_managers_warning BOOLEAN;
-- Out Variables for Update Employee Assgment Criteria
-- -------------------------------------------------------------------------------
ln_special_ceiling_step_id PER_ALL_ASSIGNMENTS_F.SPECIAL_CEILING_STEP_ID%TYPE;
lc_group_name VARCHAR2(30);
ld_effective_start_date PER_ALL_ASSIGNMENTS_F.EFFECTIVE_START_DATE%TYPE;
ld_effective_end_date PER_ALL_ASSIGNMENTS_F.EFFECTIVE_END_DATE%TYPE;
lb_org_now_no_manager_warning BOOLEAN;
lb_other_manager_warning BOOLEAN;
lb_spp_delete_warning BOOLEAN;
lc_entries_changed_warning VARCHAR2(30);
lb_tax_district_changed_warn BOOLEAN;
cursor c1 is
SELECT a.rowid,pas.effective_start_date, pas.object_version_number,pas.assignment_id,decode(a.GOSI,'Yes','Y','No','N')gosi,a.emp_no,a.status
--INTO p_effective_date, p_object_version_number,v_assignment_id
FROM per_all_assignments_f pas
,xxdfc_gosi_update a
WHERE pas.effective_end_date = TO_DATE ('12/31/4712', 'MM/DD/RRRR')
--AND pas.assignment_id in(77,913);
and a.EMP_NO=pas.ASSIGNMENT_NUMBER
--and a.emp_no in('S00455','S00641')
;
begin
for rec in c1
loop
hr_assignment_api.update_emp_asg
( -- Input data elements
-- ------------------------------
p_effective_date => sysdate, --TO_DATE('12-JUN-2011'),
p_datetrack_update_mode => 'CORRECTION', --lc_dt_ud_mode,
p_assignment_id => rec.assignment_id, --ln_assignment_id,
--p_supervisor_id => NULL,
--p_change_reason => NULL,
--p_manager_flag => 'N',
--p_bargaining_unit_code => NULL,
--p_labour_union_member_flag => NULL,
p_segment1 => 81, --DFC Business Group
p_segment3 => rec.gosi, --'Y',
--p_normal_hours => 8,
--p_frequency => 'W',
-- Output data elements
-- -------------------------------
p_object_version_number => rec.object_version_number, --ln_object_number,
p_soft_coding_keyflex_id => ln_soft_coding_keyflex_id,
p_concatenated_segments => lc_concatenated_segments,
p_comment_id => ln_comment_id,
p_effective_start_date => ld_effective_start_date,
p_effective_end_date => ld_effective_end_date,
p_no_managers_warning => lb_no_managers_warning,
p_other_manager_warning => lb_other_manager_warning
);
COMMIT;
--v_assignment_id :=null;
dbms_output.put_line('Hi-'||rec.object_version_number||'-Assignment_id-'||rec.assignment_id);
update xx_gosi_update set status='S-'||rec.emp_no where rowid=rec.rowid;
commit;
end loop;
--dbms_output.put_line('Hi-'||ln_object_number);
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line(SQLERRM);
--end loop;
END;
( emp_no varchar2(240)
,gosi varchar2(240)
,status varchar2(240)
)
Below is the script for update the assignment (I am updating annuities field)
======================================================================
DECLARE
-- Local Variables
-- -----------------------
lc_dt_ud_mode VARCHAR2(100) := NULL;
ln_assignment_id NUMBER := 1336;
ln_supervisor_id NUMBER := 2;
ln_object_number NUMBER := 5;
ln_people_group_id NUMBER :=null; -- 1;
p_effective_date date;
p_object_version_number number;
v_assignment_id number;
-- Out Variables for Find Date Track Mode API
-- -----------------------------------------------------------------
lb_correction BOOLEAN;
lb_update BOOLEAN;
lb_update_override BOOLEAN;
lb_update_change_insert BOOLEAN;
-- Out Variables for Update Employee Assignment API
-- ----------------------------------------------------------------------------
ln_soft_coding_keyflex_id HR_SOFT_CODING_KEYFLEX.SOFT_CODING_KEYFLEX_ID%TYPE;
lc_concatenated_segments VARCHAR2(2000);
ln_comment_id PER_ALL_ASSIGNMENTS_F.COMMENT_ID%TYPE;
lb_no_managers_warning BOOLEAN;
-- Out Variables for Update Employee Assgment Criteria
-- -------------------------------------------------------------------------------
ln_special_ceiling_step_id PER_ALL_ASSIGNMENTS_F.SPECIAL_CEILING_STEP_ID%TYPE;
lc_group_name VARCHAR2(30);
ld_effective_start_date PER_ALL_ASSIGNMENTS_F.EFFECTIVE_START_DATE%TYPE;
ld_effective_end_date PER_ALL_ASSIGNMENTS_F.EFFECTIVE_END_DATE%TYPE;
lb_org_now_no_manager_warning BOOLEAN;
lb_other_manager_warning BOOLEAN;
lb_spp_delete_warning BOOLEAN;
lc_entries_changed_warning VARCHAR2(30);
lb_tax_district_changed_warn BOOLEAN;
cursor c1 is
SELECT a.rowid,pas.effective_start_date, pas.object_version_number,pas.assignment_id,decode(a.GOSI,'Yes','Y','No','N')gosi,a.emp_no,a.status
--INTO p_effective_date, p_object_version_number,v_assignment_id
FROM per_all_assignments_f pas
,xxdfc_gosi_update a
WHERE pas.effective_end_date = TO_DATE ('12/31/4712', 'MM/DD/RRRR')
--AND pas.assignment_id in(77,913);
and a.EMP_NO=pas.ASSIGNMENT_NUMBER
--and a.emp_no in('S00455','S00641')
;
begin
for rec in c1
loop
hr_assignment_api.update_emp_asg
( -- Input data elements
-- ------------------------------
p_effective_date => sysdate, --TO_DATE('12-JUN-2011'),
p_datetrack_update_mode => 'CORRECTION', --lc_dt_ud_mode,
p_assignment_id => rec.assignment_id, --ln_assignment_id,
--p_supervisor_id => NULL,
--p_change_reason => NULL,
--p_manager_flag => 'N',
--p_bargaining_unit_code => NULL,
--p_labour_union_member_flag => NULL,
p_segment1 => 81, --DFC Business Group
p_segment3 => rec.gosi, --'Y',
--p_normal_hours => 8,
--p_frequency => 'W',
-- Output data elements
-- -------------------------------
p_object_version_number => rec.object_version_number, --ln_object_number,
p_soft_coding_keyflex_id => ln_soft_coding_keyflex_id,
p_concatenated_segments => lc_concatenated_segments,
p_comment_id => ln_comment_id,
p_effective_start_date => ld_effective_start_date,
p_effective_end_date => ld_effective_end_date,
p_no_managers_warning => lb_no_managers_warning,
p_other_manager_warning => lb_other_manager_warning
);
COMMIT;
--v_assignment_id :=null;
dbms_output.put_line('Hi-'||rec.object_version_number||'-Assignment_id-'||rec.assignment_id);
update xx_gosi_update set status='S-'||rec.emp_no where rowid=rec.rowid;
commit;
end loop;
--dbms_output.put_line('Hi-'||ln_object_number);
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line(SQLERRM);
--end loop;
END;