DECLARE
err_code varchar2 (50);
err_msg varchar2 (1000);
lv_pea_object_version_number NUMBER;
lv_analysis_criteria_id NUMBER;
lv_person_analysis_criteria_id NUMBER;
CURSOR EMP_DETAIL
IS
SELECT *
FROM ---TMP_SIT_TABLE
WHERE SIT_NAME = :SIT_NAME
AND (status <> 'U' OR STATUS IS NULL);
BEGIN
FOR REC IN EMP_DETAIL
LOOP
BEGIN
hr_sit_api.create_sit (
p_validate => FALSE,
p_effective_date => SYSDATE,
p_person_id => rec.PERSON_ID,
p_pea_object_version_number => lv_pea_object_version_number,
p_business_group_id => ---101,
p_id_flex_num => -----50284,
p_analysis_criteria_id => lv_analysis_criteria_id,
p_person_analysis_id => lv_person_analysis_criteria_id,
p_date_from => TO_DATE (rec.SEGMENT1,
'DD-MON-RRRR'),
p_date_to => TO_DATE (rec.SEGMENT2,
'DD-MON-RRRR'), --=> NULL,
p_segment1 => TO_CHAR (rec.SEGMENT1,
'YYYY/MM/DD HH24:MI:SS'),
p_segment2 => TO_CHAR (rec.SEGMENT2,
'YYYY/MM/DD HH24:MI:SS'),
p_segment3 => rec.segment3,
p_segment4 => rec.segment4,
p_segment5 => rec.segment5,
p_segment6 => TO_CHAR (rec.SEGMENT6,
'YYYY/MM/DD HH24:MI:SS'),
p_segment7 => rec.segment7,
p_segment8 => rec.segment8,
p_segment9 => rec.segment9,
p_segment10 => rec.segment10,
p_segment11 => rec.segment11,
p_segment12 => rec.segment12,
p_segment13 => rec.segment13,
p_segment14 => rec.segment14,
p_segment15 => rec.segment15,
p_segment16 => rec.segment16,
p_segment17 => rec.segment17,
p_segment18 => rec.segment18,
p_segment19 => rec.segment19,
p_segment20 => rec.segment20,
p_segment21 => rec.segment21,
p_segment22 => rec.segment22,
p_segment23 => rec.segment23,
p_segment24 => rec.segment24,
p_segment25 => rec.segment25,
p_segment26 => rec.segment26,
p_segment27 => TO_CHAR (rec.SEGMENT27,
'YYYY/MM/DD HH24:MI:SS'),
p_segment28 => rec.segment28,
p_segment29 => rec.segment29,
p_segment30 => rec.segment30
);
COMMIT;
UPDATE ----TMP_SIT_TABLE
SET ANALYSIS_CRITERIA_ID = lv_analysis_criteria_id,
PERSON_ANALYSIS_ID = lv_person_analysis_criteria_id,
status = 'U',
ERROR_TEXT = 'No Error'
WHERE employee_number = rec.employee_number
AND srl_no = rec.srl_no;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
err_code := SQLCODE;
err_msg := SUBSTR (SQLERRM, 1, 200);
UPDATE ----TMP_SIT_TABLE
SET status = 'E', ERROR_TEXT = err_code || ':' || err_msg
WHERE employee_number = rec.employee_number
AND srl_no = rec.srl_no;
COMMIT;
DBMS_OUTPUT.put_line (' Error Msg: ' || SQLERRM);
END;
END LOOP;
END;
err_code varchar2 (50);
err_msg varchar2 (1000);
lv_pea_object_version_number NUMBER;
lv_analysis_criteria_id NUMBER;
lv_person_analysis_criteria_id NUMBER;
CURSOR EMP_DETAIL
IS
SELECT *
FROM ---TMP_SIT_TABLE
WHERE SIT_NAME = :SIT_NAME
AND (status <> 'U' OR STATUS IS NULL);
BEGIN
FOR REC IN EMP_DETAIL
LOOP
BEGIN
hr_sit_api.create_sit (
p_validate => FALSE,
p_effective_date => SYSDATE,
p_person_id => rec.PERSON_ID,
p_pea_object_version_number => lv_pea_object_version_number,
p_business_group_id => ---101,
p_id_flex_num => -----50284,
p_analysis_criteria_id => lv_analysis_criteria_id,
p_person_analysis_id => lv_person_analysis_criteria_id,
p_date_from => TO_DATE (rec.SEGMENT1,
'DD-MON-RRRR'),
p_date_to => TO_DATE (rec.SEGMENT2,
'DD-MON-RRRR'), --=> NULL,
p_segment1 => TO_CHAR (rec.SEGMENT1,
'YYYY/MM/DD HH24:MI:SS'),
p_segment2 => TO_CHAR (rec.SEGMENT2,
'YYYY/MM/DD HH24:MI:SS'),
p_segment3 => rec.segment3,
p_segment4 => rec.segment4,
p_segment5 => rec.segment5,
p_segment6 => TO_CHAR (rec.SEGMENT6,
'YYYY/MM/DD HH24:MI:SS'),
p_segment7 => rec.segment7,
p_segment8 => rec.segment8,
p_segment9 => rec.segment9,
p_segment10 => rec.segment10,
p_segment11 => rec.segment11,
p_segment12 => rec.segment12,
p_segment13 => rec.segment13,
p_segment14 => rec.segment14,
p_segment15 => rec.segment15,
p_segment16 => rec.segment16,
p_segment17 => rec.segment17,
p_segment18 => rec.segment18,
p_segment19 => rec.segment19,
p_segment20 => rec.segment20,
p_segment21 => rec.segment21,
p_segment22 => rec.segment22,
p_segment23 => rec.segment23,
p_segment24 => rec.segment24,
p_segment25 => rec.segment25,
p_segment26 => rec.segment26,
p_segment27 => TO_CHAR (rec.SEGMENT27,
'YYYY/MM/DD HH24:MI:SS'),
p_segment28 => rec.segment28,
p_segment29 => rec.segment29,
p_segment30 => rec.segment30
);
COMMIT;
UPDATE ----TMP_SIT_TABLE
SET ANALYSIS_CRITERIA_ID = lv_analysis_criteria_id,
PERSON_ANALYSIS_ID = lv_person_analysis_criteria_id,
status = 'U',
ERROR_TEXT = 'No Error'
WHERE employee_number = rec.employee_number
AND srl_no = rec.srl_no;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
err_code := SQLCODE;
err_msg := SUBSTR (SQLERRM, 1, 200);
UPDATE ----TMP_SIT_TABLE
SET status = 'E', ERROR_TEXT = err_code || ':' || err_msg
WHERE employee_number = rec.employee_number
AND srl_no = rec.srl_no;
COMMIT;
DBMS_OUTPUT.put_line (' Error Msg: ' || SQLERRM);
END;
END LOOP;
END;
0 comments: