Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8414989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:18:53+00:00 2026-06-10T01:18:53+00:00

I have Delphi application with mydac stored procedure component which takes an utf8 encoded

  • 0

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&#39;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:

  1. delphi finds and reads file contents into a TStringStream with LoadfromFile MyStream.LoadFromFile(Sp_xmlfile);
  2. 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 &#39; 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:18:54+00:00Added an answer on June 10, 2026 at 1:18 am

    From your post, I see that you tried to use a constant value (I put this xml content copy-paste) and a parameter (T_ContentsSP.ParamByName('XmlFile')). Also, try to show error text for the command you are used, and not for a different command.

    When you are using parameters you does not need to do any special preparation. Data access components have transparently send parameter values to a DBMS. If they have tracing output, then check the trace, what library is sending to a DBMS. Parameter usage is always prefered agains literal usage !

    When you are using a constant, then you should (more):

    • double each single quote inside of the constant and prepend it by ‘\’. So, a ' will become \''.
    • double quotes rather not need a special handling.
    • probably disable macros handling, because ‘&’ may be a macro specifier in the data access library.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Delphi application which contains a manifest file with a few dependencies
We have a delphi application which can also run as a sevice . We
I have to resurrect an ancient Delphi 7 application, which means I have to
I have a Delphi 6 application that is heavily multithreaded. I have a component
I have an application built in Delphi and it accesses MySQL database using MyDAC
I have a Delphi application database of which is in Oracle. Now there's a
we have a delphi application which contains a TXTextControl (v. 13.0). This application uses
I have a Delphi application which displays an image using a TImage. The location
I have an Oracle 9 database from which my Delphi 2006 application reads data
I have a Delphi application using DevExpress cxGrid (which is connected to database). I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.