create or replace
FUNCTION REPORT_GENERATION(
IN_STATUS IN VARCHAR2
,IN_USERID IN varchar2
) RETURN CLOB AS
FINAL_RESULT CLOB:=null;
OUTPUT_RESULT CLOB:=null;
BEGIN
/* My implementation. OUTPUT_RESULT contains large XML string */
FINAL_RESULT:=FINAL_RESULT||''||OUTPUT_RESULT;
FINAL_RESULT:=FINAL_RESULT||''||'</EXCEL_MAIN>';
RETURN FINAL_RESULT;
END REPORT_GENERATION;
When I am executing this function i am getting an error
ORA-06502: PL/SQL: numeric or value error
I am getting that error while returning the FINAL_RESULT. length of FINAL_RESULT is 38123. If i replace FINAL_RESULT with some small string it is working without any issues.
How can i resolve this issue. Please help..
DBMS_LOB.APPENDfunction (docs.oracle.com/cd/E11882_01/appdev.112/e25788/…) rather than the||concatenation operator