Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CLOB datatype exceeding the limit

User_CI7SYOct 25 2021

Hi Team, I have below procedure to create input for my SOAP web service call. But it throws error.
create or replace procedure soap is
reqtxt VARCHAR2(30000 CHAR);
requrl VARCHAR2(1000 CHAR);
doc clob;
doc1 varchar2(1000 char);
--doc2 varchar2(9000 char);
doc2 clob;
doc3 varchar2(1000 char);
BEGIN
requrl := 'http://searchv1-dev.tcc.etn.com:8080/EatonSearchApp/EatonSearchWS';
doc1 := '<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.generic.eaton.com/">
<soapenv:Header/>
<soapenv:Body>
<ws:doProcess>
<arg0>';
doc3 := '</arg0>
</ws:doProcess>
</soapenv:Body>
</soapenv:Envelope>';

SELECT json_object('searchApplication' VALUE 'etndisinv',
'searchApplicationKey' VALUE 'abc123',
'function' VALUE 'search',
'searchTerms' VALUE 'ignore',
'language' VALUE 'en_US',
'startingRecordNumber' VALUE '0',
'numberOfRecordsToReturn' VALUE '6',
'filters' VALUE json_arrayagg(json_object('filterName' VALUE part_id_qualifier,
'filterValue' VALUE json_arrayagg(part_id
)))) into doc2
FROM dist_inv_trans
GROUP BY part_id_qualifier;
dbms_output.put_line('doc2 is ' || doc2);
reqtxt := doc1 || doc2 || doc3;
dbms_output.put_line('reqtxt is' || reqtxt);
END;

Error:
Error report -
ORA-40478: output value too large (maximum: 4000)
ORA-06512: at "DISTINV.SOAP", line 24
ORA-06512: at line 1
40478. 00000 - "output value too large (maximum: %s)"
*Cause: The provided JavaScript Object Notation (JSON) operator generated a
result which exceeds the maximum length specified in the RETURN
clause.
*Action: Increase the maximum size of the data type in the RETURNING clause
or use a CLOB or BLOB in the RETURNING clause.

Comments
Post Details
Added on Oct 25 2021
5 comments
2,781 views