Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FireDAC TFDScript Replacing ! and & from string litterals script file



Permlink Replies: 2 - Last Post: Sep 7, 2016 12:12 AM Last Post By: Bernd Linde
Bernd Linde

Posts: 17
Registered: 8/2/14
FireDAC TFDScript Replacing ! and & from string litterals script file
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 5, 2016 7:24 AM
Hi Dmitry,

I found a potential issue with the TFDScript.ExecuteFile when parsing SQL Strings inside an insert statement.
Sample application available on https://forums.embarcadero.com/thread.jspa?threadID=229367 with different examples.
Currently using Delphi 10 Seattle Version 23.0.21418.4207

Inside my script file, I have statements that look like this
insert into TestingTable (testID, testText, testXML)
values (4, 'Test4', '<?xml version="1.0" encoding="UTF-8"?><root><testValue1>Test1</testValue1><!-- <testValue2>22222</testValue2> --><testValue3>Test3</testValue3><testValue3>test12%&amp;$><34</testValue3></root>');


When that command is parsed, the parser removes the XML comment formatting ( <!-- becomes <-- ) and the HTML Encoding ( &amp; becomes ; )
From the source I can see that it has to do with the Arguments/Macro parser trying to replace &xxx arguments.

Is there a way to disable the Arguments/Macro parser? I could not find any way in the Help or source.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDAC TFDScript Replacing ! and & from string litterals script file
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 5, 2016 10:37 AM   in response to: Bernd Linde in response to: Bernd Linde
Try to set FDScript.ScriptOptions.MacroExpand to False.

--
With best regards,
Dmitry
Bernd Linde

Posts: 17
Registered: 8/2/14
Re: FireDAC TFDScript Replacing ! and & from string litterals script file
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 7, 2016 12:12 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
That worked, thanks Dmitry. Somehow entirely overlooked that property.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02