IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

ESQL variables

ESQL variables can be described as external variables, normal variables, or shared variables; their use is defined in the DECLARE statement.

ESQL variable names

You can use only names that conform to the rules of ESQL. That is, the names can contain only alphanumeric characters (including underscore), the first character cannot be numeric, and names must be at least one character long. You can avoid these limitations by enclosing names that do not conform to these rules in double quotation marks.

Types of variable

External
External variables (defined with the EXTERNAL keyword) are also known as user-defined properties (see User-defined properties in ESQL). They exist for the entire lifetime of a message flow and are visible to all messages that pass through the flow. You can define external variables only at the module and schema level. You can modify their initial values (optionally set by the DECLARE statement) by using the Message Flow editor, or at deployment time, by using the Broker Archive editor. You can query and set the values of user-defined properties at run time by using the IBM® Integration API (also known as the CMP). For more information, see Setting message flow user-defined properties at run time in a CMP application.
Normal
Normal variables have a lifetime of just one message passing through a node. They are visible to that message only. To define a normal variable, omit both the EXTERNAL and SHARED keywords.
Shared
Shared variables (defined with the SHARED keyword) can be used to implement an in-memory cache in the message flow; see Optimizing message flow response times. Shared variables have a long lifetime and are visible to multiple messages that pass through the flow; see Long-lived variables. They exist for the lifetime of the integration server process, the lifetime of the flow or node, or the lifetime of the node's SQL that declares the variable (whichever is the shortest). They are initialized when the first message passes through the flow or node after each broker startup.

See also the ATOMIC option of the BEGIN ... END statement. The BEGIN ATOMIC construct is useful when a number of changes have to be made to a shared variable and when it is important to prevent other instances seeing the intermediate states of the data.


ak04895_.htm | Last updated Friday, 21 July 2017