A global ESQL variable is only used once. It could be a local variable (WMB)
Local variables should be preferred over global variables. This can both aide in readability and also can affect performance, as per IBM Best Practices.
The following should be moved to the procedure or function that is using this variable.
|
BROKER SCHEMA au.com.bct.demo
DECLARE some_useful_var EXTERNAL CHARACTER ‘starting’; |
This also applies to namespaces:
| For example the DECLARE NS could be local to the module as it is never used anywhere else at the SCHEMA level | ![]() |
| Preferred – it has been moved locally to the module | ![]() |


