The following lines contain the word 'select', 'insert', 'update' or 'delete':
select top_model_line_id into l_top_model_line_id
from oe_order_lines_all where
line_id = to_number(itemkey);
select '1' into l_dummy
from oe_order_lines_all
where line_id = l_top_model_line_id
for update; --commented for bug 6415831 -- nowait;
update_screening_results
BRIEF DESCRIPTION :
This API is called when OM receives a response from ITM for the
export compliance screening results. It is responsible for updating
the order line with the screening response. Introduced as a part of
bug fix 8762350.
CALLER :
1. Called from the workflow activity UPDATE_SCREENING_RESULTS.
RELEASE LEVEL :
12.1.2 and higher.
PARAMETERS :
standard WF activity parameters
*/
PROCEDURE Update_Screening_Results (
itemtype IN VARCHAR2,
itemkey IN VARCHAR2,
actid IN NUMBER,
funcmode IN VARCHAR2,
resultout IN OUT NOCOPY /* file.sql.39 change */ VARCHAR2)
IS
CURSOR C_Resp_Lines(cp_response_header_id NUMBER) IS
SELECT wl.Error_Text, wl.denied_party_flag, wp.Party_name
FROM wsh_itm_response_lines wl,
wsh_itm_parties wp
WHERE wl.Response_header_id = cp_response_header_id
AND wp.party_id = wl.party_id;
SELECT request_control_id, response_header_id, organization_id,
nvl(original_system_line_reference, 0) line_id,
nvl(original_system_reference, 0) header_id --bug 4503620
FROM wsh_itm_request_control wrc
WHERE request_control_id = nvl(cp_request_control_id, 0)
AND wrc.application_id = 660
UNION
SELECT request_control_id, response_header_id, organization_id,
nvl(original_system_line_reference, 0) line_id,
nvl(original_system_reference, 0) header_id --bug 4503620
FROM wsh_itm_request_control wrc
WHERE request_set_id = nvl(cp_request_set_id, 0)
AND wrc.application_id = 660;
l_api_name CONSTANT VARCHAR2(30) := 'Update_Screening_Results';
OE_DEBUG_PUB.Add('Entering Update_screening_results...');
SAVEPOINT UPDATE_API;
SELECT org_id
INTO l_org_id
FROM oe_order_lines_all
WHERE line_id = to_number(itemkey);
SELECT top_model_line_id
INTO l_top_model_line_id
FROM oe_order_lines
WHERE line_id = l_line_id;
SELECT '1'
INTO l_dummy
FROM oe_order_lines_all
WHERE line_id = l_top_model_line_id
FOR UPDATE
--Commented for bug 6415831
NOWAIT; -- Uncommented for 8762350
SELECT '1'
INTO l_dummy
FROM oe_order_lines_all
WHERE line_id = l_line_id
FOR UPDATE
--Commented for bug 6415831
NOWAIT; -- Uncommented for 8762350
SELECT 'Y'
INTO l_dummy
FROM ONT_DBI_CHANGE_LOG
WHERE line_id = l_line_id
FOR UPDATE NOWAIT;
ROLLBACK TO UPDATE_API;
-- Update Work flow Status Code
OE_ORDER_WF_UTIL.Update_Flow_Status_Code (
p_line_id => l_line_id,
p_flow_status_code => 'EXPORT_SCREENING_COMPLETED',
x_return_status => l_return_status
);
SELECT error_text
INTO l_error_text
FROM wsh_itm_response_headers
WHERE response_header_id = l_response_header_id;
OE_ORDER_WF_UTIL.Update_Flow_Status_Code
(p_line_id => l_line_id,
p_flow_status_code => 'EXPORT_SCREENING_DATA_ERROR',
x_return_status => l_return_status
);
OE_Order_WF_Util.Update_Flow_Status_Code
(p_line_id => l_line_id,
p_flow_status_code => 'EXPORT_SCREENING_COMPLETED',
x_return_status => l_return_status
);
OE_Order_WF_Util.Update_Flow_Status_Code
(p_line_id => l_line_id,
p_flow_status_code => 'EXPORT_SCREENING_COMPLETED',
x_return_status => l_return_status
);
OE_ORDER_WF_UTIL.Update_Flow_Status_Code
(p_line_id => l_line_id,
p_flow_status_code => 'EXPORT_SCREENING_COMPLETED',
x_return_status => l_return_status
);
wf_core.context('OE_EXPORT_COMPLIANCE_WF', 'Update_Screening_Results',
itemtype, itemkey, to_char(actid), funcmode);
ROLLBACK TO UPDATE_API;
'Update_Screening_Results'
);
END Update_screening_results;