Update SIT API Script
DECLARE
p_person_id NUMBER := NULL;
p_business_group_id NUMBER;
p_id_flex_num NUMBER;
------------------
p_analysis_criteria_id NUMBER := NULL;
p_person_analysis_id NUMBER := NULL;
p_per_object_version_number NUMBER := NULL;
v_err VARCHAR2 (1000) := NULL;s
driving_license_number VARCHAR2 (100) := NULL;
CURSOR c1
IS
SELECT
FROM xx_hrms_sit_upload
WHERE status is not null;
BEGIN
FOR i IN c1
LOOP
p_id_flex_num := 50530;
BEGIN
SELECT NVL (sit.object_version_number, 1),
sit.analysis_criteria_id, MAX (sit.person_analysis_id)
INTO p_per_object_version_number,
p_analysis_criteria_id, p_person_analysis_id
FROM fnd_id_flex_structures_tl sttl,
fnd_id_flex_structures st,
per_person_analyses sit,
per_analysis_criteria sv
WHERE sttl.id_flex_structure_name = 'Driving License'
AND sttl.LANGUAGE = USERENV ('LANG')
AND st.id_flex_code = sttl.id_flex_code
AND st.id_flex_num = sttl.id_flex_num
AND st.id_flex_num = sit.id_flex_num
AND st.id_flex_num = sv.id_flex_num
AND sit.analysis_criteria_id = sv.analysis_criteria_id
AND sit.person_id = i.person_id
--and sv.SEGMENT1 = '4602001140'
GROUP BY sv.segment1,
NVL (sit.object_version_number, 1),
sit.analysis_criteria_id;
END;
BEGIN
hr_sit_api.update_sit
(p_validate => FALSE,
p_person_analysis_id => p_person_analysis_id,
p_pea_object_version_number => p_per_object_version_number,
p_date_from => TRUNC (SYSDATE),
p_segment1 => i.driving_license_number,
p_analysis_criteria_id => p_analysis_criteria_id
);
UPDATE xx_hrms_sit_upload xx
SET xx.status = 'S'
WHERE xx.sno=i.sno;
EXCEPTION
WHEN OTHERS
THEN
v_err := SQLERRM;
UPDATE xx_hrms_sit_upload xx
SET xx.status = 'E',xx.error_msg = v_err
WHERE sno=i.sno;
END;
END LOOP;
COMMIT;
END;
No comments:
Post a Comment