Professional Documents
Culture Documents
Variables: Types of Variables Variables Are of Three Types 1. External
Variables: Types of Variables Variables Are of Three Types 1. External
A variable is a name of the memory location. It is used to store data. Its value can be
changed, and it can be reused many times. You must declare a variable and state its
type before you can use it. The data type of a variable is fixed
To define a variable and give it a name, use the DECLARE statement. The names of
ESQL variables are case-sensitive; therefore, make sure that you use the correct case
in all places.
You can assign an initial value to the variable on the DECLARE statement. If an
initial value is not specified, scalar variables are initialized with the special value
NULL, and ROW variables are initialized to an empty state. Then, you can change the
value of a variable by using the SET statement.
Types of variables
Variables are of three types 1. External
2.Normal
3.Shared
1.External
External variables are also known as user-defined.
When we need a variable whose values are set at deployment time, we can create User
defined property or External variables. External variables must be declared within the
schema or module scope before actually using it. UDPs can be accessed by any built-
in node that uses ESQL or JAVA. External variables are accessible anywhere in the
flow and are not restricted to any particular node. External variable can be initialized
by either the message flow editor (UDP) or BAR file. For every message which
passes through the Flow, a new instance of these variables will be created.
EXTERNAL variable value cannot be changed by ESQL.
Scope: for all messages passing through the flow
Lifetime: Till the message flow stops.
Example
Three types of built-in node can contain ESQL code and therefore support the use of
ESQL variables:
Compute node.
Database node.
DatabaseInput node.
Filter node.