PgDAC

TCustomDADataSet.Macros Property

Makes it possible to change SQL queries easily.

Class

TCustomDADataSet

Syntax

property Macros: TMacros stored False;

Remarks

With the help of macros you can easily change SQL query text at design- or runtime. Marcos extend abilities of parameters and allow to change conditions in a WHERE clause or sort order in an ORDER BY clause. You just insert &MacroName in the SQL query text and change value of macro in the Macro property editor at design time or call the MacroByName function at run time. At the time of opening the query macro is replaced by its value.

Example

PgQuery.SQL.Text := 'SELECT * FROM Dept ORDER BY &Order';
PgQuery.MacroByName('Order').Value:= 'DeptNo';
PgQuery.Open; 

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback