2
votes

We have table1 in SQLITE database.

  CREATE TABLE table1 (id int PRIMARY KEY ,name nvarchar );    

After using in DELPHI XE3 Firedac ADQuery SQL command

  INSERT INTO table1 (id,name)  VALUES (1,'&Text To &Insert.')

we have in column name only "To ." All the text starting with & symbol until any punctuation symbol is not copied! there are 2 exceptions: Texts followed by && or \& are being copied correctly. The same command in Sqlite Expert Personal app works OK.

Is it Firedac bug? And How Copy texts into database containing & symbol using Firedac? (texts are HTML documents containing many "&" symbols)

1
This has nothing to do with SQLite or FireDAC. You text is not valid HTML. - CL.
This error I noticed when after inserting valid html document instead of line "<P>&nbsp;</P>" there was "<P>;</P>" in the column "name". - Avrob
Forget about html. In given example after inserting string "&Text To &Insert." we have in column name only "To .": All the text starting with & symbol until any punctuation symbol or space is not copied! - Avrob
Look up how entities in HTML (SGML) work. - CL.
Dear CL. Forget about HTML. Let's talk about the string "&Text To &Insert.". After inserting with Firedac ADQUERY into field name, we have there only "To ." . The same command in Sqlite Expert Personal app, which I suppose does not use Firedac, Inserts the given string correctly. - Avrob

1 Answers

3
votes

This is a FAQ:

Q8: My query containing the '&', '!' characters fails to execute correctly. What is wrong?

[…] '&' specifies the beginning of a macro variable. […] If you do not use macros, then set ResourceOptions.MacroCreate and MacroExpand to False.