Search code examples
sqlitedelphifiredac

FireDac not insert "&" symbol into SQLITE varchar


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)


Solution

  • 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.