Einzelnen Beitrag anzeigen

Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.015 Beiträge
 
Delphi 12 Athens
 
#5

AW: Insert Values die "!" enthalten

  Alt 28. Jan 2022, 09:48
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.
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat