title: Delphi Mysql Stored Procedure Single Quote Trouble
body: <p>I have Delphi application with mydac stored procedure component which takes an utf8 encoded xml file's content as string parameter. 
  It works with navicat and other db managment programs when I put this xml content copy-paste from file to procedure like</p>
  
  <pre><code>CALL sp_saveit('&lt;xml&gt;garry&amp;#39;s&lt;otherdata&gt; data data....&lt;/xml&gt;);
  </code></pre>
  
  <p>But when I try to call it from delphi it throws error </p>
  
  <pre><code>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CALL sp_saveit('&lt;?xml version=\"1.0\" encoding="UTF-8"?&gt;&lt;Main&gt;&lt;Detail z') at line 1
  </code></pre>
  
  <p><em>Am following those steps:</em></p>
  
  <ol>
  <li>delphi finds and reads file contents into a TStringStream with LoadfromFile <code>MyStream.LoadFromFile(Sp_xmlfile);</code></li>
  <li>then am passing contents to stored procedure <code>T_ContentsSP.ParamByName('XmlFile').AsWideString := MyStream.DataString;</code></li>
  </ol>
  
  <p>Also I've tried to compress this data with delphi's zlib and send as blob, I've tried to change <code>&amp;#39;</code> with ' but result was same.</p>
  
  <p>How can I send a long string with single and double quotes inside as parameter for sp with delphi?</p>
  
  <p>p.s : sorry for my english.</p>