Script Execution Control commands.
IBAdmin introduces the extension to the script execution procedure to allow you to execute your script based on some conditions or even database state. The ability to include external files also increases the script management possibilities.
Script execution control commands must be in comment pairs and begins from $: /*$include somefile.sql */. Here is the full list of available commands:
INCLUDE - includes external file and executes it as a part of script. Example: /*$include myfile.sql*/
<condition>={<variable 1><operator><variable 2>|<variable><operator><value>}
<operator>= {= | < | > | >= | <= | <> }
Example: /*$IF SystemVersion>=10 */
Take a look at the demonstration script included with IBAdmin in "demos" directory. The test.sql file is a main script file to execute. The "droptable.sql" is an external file that included in the main file.
This script can be run 4 times. First time it creates table "VERSION_HISTORY" and inserts some value to it. Next two times it inserts the next version records. And at fourth run it drops the table "VERSION_HISTORY". It's a good demonstration how to use IF, SET and INCLUDE commands.