Setzt mal in der FDQuery folgende Eigenschaften auf False: ResourceOptions.MacroCreate, MacroExpand.
Hintergrund:
https://docwiki.embarcadero.com/RADS...tion_Variables
Zitat:
Substitution Variables
A substitution variable starts with the ‘!’ or ‘&’ symbol and is followed by the macro variable name. For example:
SELECT * FROM &TabName
The symbols have the following meaning:
‘!’--“string” substitution mode. The macro value will be substituted “as is”, directly into the command text without any transformation.
‘&’-–“
SQL” substitution mode. The macro value will be substituted depending on the macro data type, using target
DBMS syntax rules.
To use the macros, use the following code snippet:
FDQuery1.SQL.Text := 'SELECT * FROM &TabName';
FDQuery1.MacroByName('TabName').AsRaw := 'Orders';
FDQuery1.Open;
The macros are processed when ResourceOptions.MacroCreate and MacroExpand are set to True.