I have a query which results me with below error: ORA-19041: Comment data cannot contain two consecutive '-'s
SQL Query:
SELECT XMLElement("errorlist", fXML.cdata('ORA31011: XML parsing failed
ORA19213: error occurred in XML processing at lines 1
LPX00214: CDATA section did not end in "]]>"')) FROM dual;
in this code, fXML.cdata is a function:
FUNCTION CData(ValueExpr VARCHAR2) RETURN XMLTYPE
IS BEGIN RETURN obj.fxml.CData(ValueExpr); END;
and obj.fxml.CData is a TYPE:
FINAL STATIC FUNCTION CData(ValueExpr VARCHAR2) RETURN XMLTYPE,
Even when I removed "-" from the passed string, it was giving me with the same error.
But When I remove "]]>", it process normally. Since the fetched data is stored in cdata. e.g.:
<errorlist><![CDATA[ORA-31011: XML parsing failed
ORA-19213: error occurred in XML processing at lines 1
LPX-00214: CDATA section did not end in ]]></errorlist>
But my constraint is to process data containing "]]>" as well.