Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

String Literal Limitation On Passing XML Doc In Query

I am trying to pass a large XML document to an Oracle PLSQL procedure as a CLOB via an MII SQL Fixed Query.  It works if the file size is relatively small but not for large files.  Beyond a certain point I get a "string literal too long" error.

Here is what my fixed query looks like:

DECLARE

xmlData CLOB;

BEGIN

   xmlData := '[Param.1]';

  -- line below is calling my PLSQL procedure

  insert_from_xml_doc( xmlData, 'tableNameHere');

END

I believe the "string literal too long" error is because of this statement above:

xmlData := '[Param.1]';

It makes sense to me that it would break if that string literal in the single quotes is too long but I don't know of another way to get the data to the CLOB variable.

Does anyone know of a workaround for this limitation?  I am getting the XML data from a machine's log file in the factory and posting it to an MII transaction via the PCo File Monitor capability.  From the transaction I am calling the SQL query.

Thank you,

Mike

Former Member
Former Member replied

I eventually found that this thread from 2012:

http://scn.sap.com/thread/3143010

pretty much had the answer.  I was using Oracle 11g and MII V15.  I did not need to make any driver changes.

All I had to do to get this to work was change this line:

xmlData := '[Param.1]';

to this:

xmlData := [Param.1];  -- no single quotes

and, on the Parameters page of my Query Template, I had to check the Use Typed Parameters checkbox and choose the String type for parameter 1.

After making the above changes I was able to pass a string that was over 1 megabyte without a problem.

2 View this answer in context
Not what you were looking for? View more on this topic or Ask a question