Additional
Overview
Features >>
History
Download
Forum
Tickets
Polls
Which driver do you use or will use most of time ?
 
Command text macro processing
 PDFPrintE-mail
Jan 18, 2007

AnyDAC has an extended command macro processor. It provides for dynamical changing of command text before being sent to the DBMS, hide SQL dialect differences and perform conditional expansion of command text.

 

AnyDAC supports three kinds of macro instructions.

 

Substitution variables: These allow substitution by putting parameters in command text. This extends the use of parameters. For example, to parameterize a table name in FROM clauses or column names in SELECT clauses substitution variables can be used where parameters are of no use. For example:

SELECT * FROM &Tab

 

Conditional escape sequences: These allow for an expanded SQL command (conditionally), depending on application defined attributes or currently attached DBMS. For example:

SELECT * FROM MyTab WHERE Year = {fn YEAR({fn NOW()}
{if (Oracl, TO_CHAR, MSSQL, CONVERT)} -> TO_CHAR on Oracle.