Order of variable parsing
AE environment variables are processed in a defined order. This can result in variables overriding those of the same name that were processed earlier. The order of processing is:
| Type | Description | Overrides... |
|---|---|---|
| 1. Include before | Includes these files before the top-level registration environment variables. See “AE Environment Variable Include Files.” | |
| 2. Registered | Prefaced with NZAE_REGISTER_, which is stripped from the name, See “AE Environment Variables and register_ae ,” the --environment description. These are a special case of top-level registration variables. | Include before |
| 3. Normal | Specified as a variable in a SQL CREATE command (as done by register_ae) . These are also known as top-level registration variables. | Registered or include before |
| 4. Include after | Includes these files after the top-level registration environment variables. See AE Environment Variable Include Files. | Normal, registered, or include before |
| 5. Dynamic | Passed in as an argument to a function. See Setting Dynamic AE Environment Variables. | Include after, normal, registered, or include before |
Considerations:
- An environment variable can override any variable with the same name that was added in earlier processed section types (see the table above). Additionally, an environment variable in an include file can also override any variables with the same name that have come earlier in the include processing. In all other section types (Registered, Normal, Dynamic) having two variables with the same name in the same section type results in undefined behavior.
- Multiple "Include Before" and "Include After" are added in alphabetical order; variables inside the include files are added in definition order.
- Top-level environment variables (those specified in a DDL) are processed in alphabetical order. However, the top-level registration environment variable key names must not duplicate other top level variable key names.