Lifetime and Scope of Variables

Variables of a transaction are of local scope (they can be used only inside the transaction) but have a global life span (they are created at the beginning of a simulation and are destroyed at the end of the simulation; compare defining a static variable in a C function). Therefore transaction variables are initialized once and can hold their values over multiple calls of the transaction. Global variables are of global scope and global life span.

Random variables are of global scope (they can be used in any transaction, SQL command or workload description). The value of a random variable is refreshed each time the variable is used.

Note: Global variables are of global scope to the script where they are defined but of local scope to the users defined in the workload section of the script.