You can use square brackets [ ] to test for the existence or value of a variable.
Include optional strings and variables, or lists of strings and variables in the syntax of SQL statements: [%variable%]
Test the value of a variable and insert or reconsider a value depending of the result of the test: [%variable%? true : false]
Test the content of a variable [%variable%=constant? true : false]
Variable |
Generation |
---|---|
[%variable%] |
Tests for the existence of the variable. Generation: Generated only if variable exists and is not assigned NO or FALSE. Reverse: Evaluated if the parser detects a SQL statement corresponding to the variable and it is not assigned NO or FALSE. |
[%variable%? true : false] |
Tests for the existence of the variable and allows conditional output. Generation: true is generated if variable exists and is not assigned NO or FALSE. Otherwise, false is generated. Reverse: If the parser detects variable and it is not assigned NO or FALSE, true is reversed. Otherwise, false is reversed. variable is set to True or False as appropriate. |
[%variable%=constant? true : false] |
Tests the value of the variable and allows conditional output. Generation: If variable equals constant, true is generated. Otherwise, false is generated. Reverse: If the parser detects thatvariable equals constant, true is reversed. Otherwise, false is reversed. |
[.Z: [item1][item2]...] |
Specifies that the items do not have a significant order. Generation: .Z is ignored Reverse: The items can be reversed in any order they are encountered. |
[.O: [item1][item2]...] |
Specifies that the items are synonyms, only one of which should be output. Generation: Only the first item listed is generated. Reverse: The reverse parser must find one of the items to validate the full statement. |
[%OPTIONS%]
If %OPTIONS% (physical options for the objects visible in the object property sheet) exists and is not assigned NO or FALSE, it is generated to the value of %OPTIONS%.
[default %DEFAULT%]
If the statement default 10 is found during reverse engineering, %DEFAULT% is assigned the value 10, but the statement is not mandatory and reversing continues even if it is absent. In script generation, if %DEFAULT% has a value of 10, it is generated as default 10 otherwise nothing is generated for the block.
[%MAND%? not null : null ]
If %MAND% is evaluated as true or contains a value other than False or NO, it is generated as not null. Otherwise it is generated as null.
[%DELCONST%=RESTRICT?:[on delete %DELCONST%]]
If %DELCONST% contains the value RESTRICT, it is generated as on delete RESTRICT.
%COLUMN% %DATATYPE%[.Z: [%NOTNULL%][%DEFAULT%]]
[.O:[procedure][proc]]
This statement will generate procedure. During reverse engineering, the parser will match either procedure or proc keywords.
create [or replace] view %VIEW% as %SQL%
A script containing either create or create or replace will be correctly reversed because or replace is optional.