Thanks for the suggestion. I have modified the code as shown below,
CREATE OR REPLACE PROCEDURE test_task (
p_quote_number IN cct_quote.quote_number%TYPE,
p_quote_revision IN cct_quote_revisions.quote_revision%TYPE,
p_return_status OUT NOCOPY VARCHAR2
) AS
CURSOR cur_create_task IS
SELECT DISTINCT
co.opportunity_number,
co.opportunity_id,
cq.quote_id,
cqr.quote_revision,
cpq.queue_name
FROM
cct_opportunity co,
cct_quote cq,
cct_quote_revisions cqr,
cct_parts_queue cpq,
cct_quote_parts cqp
WHERE
co.opportunity_id = cq.opportunity_id
AND
cq.quote_id = cqr.quote_id
AND
cqr.revision_id = cqp.quote_revision_id
AND
cpq.queue_id = cqp.queue_id
AND
cq.quote_number = p_quote_number
AND
cqr.quote_revision = p_quote_revision;
l_cur_val cur_create_task%rowtype;
l_soap_request VARCHAR2(32767);
l_soap_response VARCHAR2(32767);
l_http_request utl_http.req;
l_http_response utl_http.resp;
l_action VARCHAR2(4000) := '';
l_opp_number cct_opportunity.opportunity_number%TYPE;
l_opp_id cct_opportunity.opportunity_id%TYPE;
l_quote_id cct_quote.quote_id%TYPE;
l_quote_revision cct_quote_revisions.quote_revision%TYPE;
l_queue_name cct_parts_queue.queue_name%TYPE;
l_created_by VARCHAR2(50);
l_role VARCHAR2(50);
l_task_creatation_bollean VARCHAR2(10) := 'TRUE';
l_task_type VARCHAR2(10) := 'NEW';
l_task_title VARCHAR2(50) := 'ManagePricing';
BEGIN
OPEN cur_create_task;
LOOP
FETCH cur_create_task INTO l_cur_val;
IF
l_cur_val.queue_name = 'Commodity'
THEN
l_role := 'CCT_COMMODITY';
ELSIF l_cur_val.queue_name = 'Advance Sourcing' THEN
l_role := 'CCT_ADVANCED_SOURCING';
ELSIF l_cur_val.queue_name = 'HPP' THEN
l_role := 'CCT_HPP';
ELSIF l_cur_val.queue_name = 'Lighting' THEN
l_role := 'CCT_LIGHTING';
ELSIF l_cur_val.queue_name = 'Kitting' THEN
l_role := 'CCT_KITTING';
ELSIF l_cur_val.queue_name = 'Strategic Pricing' THEN
l_role := 'CCT_PRICING_MANAGER';
ELSIF l_cur_val.queue_name = 'Chemical' THEN
l_role := 'CCT_CSM';
END IF;
l_http_request := utl_http.begin_request(
'
http://10.98.171.13:7005/ManageBPMTasks/ProxyServices/CreateBPMTask', 'POST',
'HTTP/1.1'
);
l_soap_request := '<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="
http://www.klx.com/cct/task/V1.0" >
<soapenv:Header/>
<soapenv:Body>
<v1:Task>
<v1:OpportunityNumber>'
|| l_cur_val.opportunity_number
|| '</v1:OpportunityNumber>
<v1:OpportunityId>'
|| l_cur_val.opportunity_id
|| '</v1:OpportunityId>
<!--Optional:-->
<v1:QuoteId>'
|| l_cur_val.quote_id
|| '</v1:QuoteId>
<!--Optional:-->
<v1:QuoteVersion>'
|| l_cur_val.quote_revision
|| '</v1:QuoteVersion>
<v1:RoleDetails>
<!--Zero or more repetitions:-->
<v1:Role>
<!--Optional:-->
<v1:RoleName>'
|| l_role
|| '</v1:RoleName>
<!--Optional:-->
<v1:IsTaskCreationRequired>'
|| l_task_creatation_bollean
|| '</v1:IsTaskCreationRequired>
</v1:Role>
</v1:RoleDetails>
<v1:CreatedBy></v1:CreatedBy>
<!--Optional:-->
<v1:Attribute1></v1:Attribute1>
<!--Optional:-->
<v1:Attribute2></v1:Attribute2>
<!--Optional:-->
<v1:Attribute3></v1:Attribute3>
<!--Optional:-->
<v1:Attribute4></v1:Attribute4>
<!--Optional:-->
<v1:Attribute5></v1:Attribute5>
<!--Optional:-->
<v1:TaskType>'
|| l_task_type
|| '</v1:TaskType>
<v1:TaskTitle>'
|| l_task_title
|| '</v1:TaskTitle>
</v1:Task>
</soapenv:Body>
</soapenv:Envelope>';
utl_http.set_header(
l_http_request,
'Content-Type',
'text/xml'
);
utl_http.set_header(
l_http_request,
'Content-Length',
length(l_soap_request)
);
utl_http.set_header(
l_http_request,
'SOAPAction',
'"
http://xmlme.com/WebServices/GetSpeech"' );
utl_http.write_text(
l_http_request,
l_soap_request
);
l_http_response := utl_http.get_response(l_http_request);
BEGIN
utl_http.read_text(
l_http_response,
l_soap_response
);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(l_http_response);
WHEN utl_http.too_many_requests THEN
utl_http.end_response(l_http_response);
END;
utl_http.end_response(l_http_response);
p_return_status := 'SUCCESS';
END LOOP;
CLOSE cur_create_task;
EXCEPTION
WHEN utl_http.request_failed THEN
g_msg := substr(
utl_http.get_detailed_sqlerrm,
1,
50
);
g_code := sqlcode;
cct_create_errors.record_error(
p_opportunity_id => l_opp_id,
p_quote_revision => l_quote_revision,
p_quote_number => p_quote_number,
p_error_message => g_msg,
p_error_type => g_code,
p_module_name => 'test_task'
);
WHEN utl_http.too_many_requests THEN
utl_http.end_response(l_http_response);
p_return_status := 'FAILURE';
END test_task;
The cursor has only 3 records.
Thanks.