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
CALL sp_saveit('<xml>garry's<otherdata> data data....</xml>);
But when I try to call it from delphi it throws error
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('<?xml version=\"1.0\" encoding="UTF-8"?><Main><Detail z') at line 1
Am following those steps:
- delphi finds and reads file contents into a TStringStream with LoadfromFile
MyStream.LoadFromFile(Sp_xmlfile);
- then am passing contents to stored procedure
T_ContentsSP.ParamByName('XmlFile').AsWideString := MyStream.DataString;
Also I've tried to compress this data with delphi's zlib and send as blob, I've tried to change '
with ' but result was same.
How can I send a long string with single and double quotes inside as parameter for sp with delphi?
p.s : sorry for my english.