DECLARE
lv_group_name VARCHAR2(200) := 'HR_51';
ln_business_group_id NUMBER;
ln_job_group_id NUMBER;
ln_job_id NUMBER;
ln_object_version_number NUMBER;
ln_job_definition_id NUMBER;
lv_job_name VARCHAR2(200);
CURSOR C1 IS
SELECT INITCAP(A)JOB_NAME
FROM TESTA
where UPPER(A) NOT IN (SELECT UPPER(NAME) FROM PER_JOBS)
;
BEGIN
-- get group id and business group id
BEGIN
SELECT business_group_id,
job_group_id
INTO ln_business_group_id,
ln_job_group_id
FROM per_job_groups
--WHERE displayed_name = lv_group_name;
where business_group_id = 81;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Unable to get the job group details.Error:'||SQLERRM);
RAISE;
END;
FOR I IN C1 LOOP
BEGIN
HR_JOB_API.CREATE_JOB
(p_validate => FALSE
,p_business_group_id => ln_business_group_id
,p_date_from => TO_DATE('01-JAN-1950')
,p_comments => 'Uploaded from API 31032022'
,p_date_to => NULL
,p_job_group_id => ln_job_group_id
,p_concat_segments => i.JOB_NAME
,p_language_code => 'US'
,p_job_id => ln_job_id
,p_object_version_number => ln_object_version_number
,p_job_definition_id => ln_job_definition_id
,p_name => lv_job_name
);
UPDATE TESTA SET B = 'DONE'
WHERE A = I.JOB_NAME;
DBMS_OUTPUT.PUT_LINE('JOB ID: '||ln_job_id);
DBMS_OUTPUT.PUT_LINE('OBJECT_VERSION_NUMBER: '||ln_object_version_number);
DBMS_OUTPUT.PUT_LINE('JOB_DEFINITION_ID: '||ln_job_definition_id);
DBMS_OUTPUT.PUT_LINE('JOB_NAME: '||lv_job_name);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Unable to create a job.Error:'||SQLERRM);
--RAISE;
UPDATE TESTA SET B = 'ERROR'
WHERE A = I.JOB_NAME;
END;
END LOOP;END;
This blog is sharing knowledge of my experience and others. Please do test in your test environment before deploying into prod instance.
Search This Blog
Wednesday, March 30, 2022
create job api for Oracle Apps R12
Tuesday, March 29, 2022
Oracle sql query using _ (underscore) in condition
Query 1:
SELECT * FROM FND_USER
WHERE
USER_NAME LIKE 'FC_%';
Output: FCCI, FC_
Query 2:
SELECT * FROM FND_USER
WHERE
REPLACE(USER_NAME, '_', '~') LIKE 'FC~%';
Output: Only FC_
Monday, March 7, 2022
Apps R12 report output in text layout width issue
Step1: Concurrent Program --> Style: BACS,
Style Required checked
keep Rows and Columns fields blank.
Step2: in the rdf file
Paper Layout --> Main Section -> Orientiation Landscape
Report Width --> 100 or 200 or 300
Section Width --> 20
Run the report in the report builder itself and check the output, drag if needed the width here itself.