Insert or update records in the
QA_RESULTS_INTERFACE table with the desired quality results data.
Ensure all
mandatory columns are populated and the UPDATE_FLAG is set appropriately:
UPDATE_FLAG = 2 for updating existing QA_RESULTS records. Any other value for
UPDATE_FLAG (or leaving it null) will create new QA_RESULTS records.
For
updates, the MATCHING_ELEMENTS column in QA_RESULTS_INTERFACE must be populated
to identify the target QA_RESULTS record.
ln_user_id NUMBER := 54667;
ln_resp_id NUMBER := 44234;
ln_resp_appl_id NUMBER := 11276;
ld_last_update_date DATE := SYSDATE;
l_sql VARCHAR2(2000);
ln_request_id NUMBER;
BEGIN
l_sql := 'INSERT INTO qa_results_interface
(
collection_id
,organization_id
,organization_code
,plan_id
,plan_name
,matching_elements
,validate_flag
,insert_type
,process_status
,last_update_date
,last_updated_by
,character11
)
VALUES(
2334
,124
,:organization_code
,345
,:plan_name
,:matching_elements
,2
,2
,1
,:last_update_date
,-1
,:character11
)';
EXECUTE IMMEDIATE l_sql USING
'ERT' -- organization_code
,'XXINV_COLLECTION_PLAN' -- plan_name
,'COLLECTION_ID' -- matching_elements
,ld_last_update_date -- last_update_date
,'Update Testing'; -- character11
-- Call standard import program to update base table.
BEGIN
fnd_global.apps_initialize (ln_user_id, ln_resp_id, ln_resp_appl_id);
ln_request_id := fnd_request.submit_request
( application => 'QA'
,program => 'QLTTRAMB' -- Collection Import Manager
,argument1 => '200'
,argument2 => '2' -- 2 for update, 1 for Insert/create
,argument3 => ln_user_id
,argument4 => 'Yes'
);
EXCEPTION
WHEN others THEN
dbms_output.put_line(' --> Error1: '||SQLERRM);
END;
EXCEPTION
WHEN others THEN
dbms_output.put_line(' --> Error in main script is: '||SQLERRM);
END;
/
Base table: QA.QA_RESULTS
Interface table: QA.QA_RESULTS_INTERFACE
Interface Error table: QA.QA_INTERFACE_ERRORS
No comments:
Post a Comment