[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Automatically handle pre-processor defines
Source position: sqldb.pp line 666
published property TSQLScript.UseDefines; |
UseDefines will automatically register the following pre-processing directives:
#IFDEF #IFNDEF #ELSE #ENDIF #DEFINE #UNDEF #UNDEFINE
Additionally, these directives will be automatically handled by the TSQLScript component. This can be used to add conditional execution of the SQL script: they are treated as the conditional compilation statements found in the C macro preprocessor or the FPC conditional compilation features. The initial list of defined macros can be specified in the Defines property, where one define per line can be specified.
In the following example, the correct statement to create a sequence is selected based on the presence of the macro FIREBIRD in the list of defines:
#IFDEF FIREBIRD CREATE GENERATOR GEN_MYID; #ELSE CREATE SEQUENCE GEN_MYID; #ENDIF
|
The script to execute |
|
|
Defined macros |