The table `Variables` holds one row per scripting variable in effect in the current process. The scripting variables themselves are described in [[Invantive Script/Variables|Variables]] and the ones the product fills of its own accord in [[Pre-defined Variables]].
The columns of the table `Variables` are:
- `NAME` (`varchar2`): name of the variable.
- `VALUE` (`varchar2`): value of the variable.
- `IS_ENCRYPTED` (`boolean`): whether the value is held encrypted. A variable set with a plain define is not encrypted.
- `DATA_TYPE` (`varchar2`): data type of the value.
- `DEFINED_UTC` (`datetime`): moment at which the variable was given its current value (UTC).
- `DEFINED_BY_STATEMENT_ID` (`int64`): identifier of the statement which gave the variable its current value, referring to [[StatementExecutions]]. Empty for a variable which was not set by a statement.
- `RUN_ID` (`int64`): identifier of the run in which the variable was set, referring to [[Runs]].
- `ORIGIN` (`varchar2`): where the variable came from. One of `DEFINE` for a variable set by a define statement, `PARAMETER` for one handed over as a parameter of the run and `ENVIRONMENT` for one taken from the environment of the process.
The table holds the state at the moment of the query rather than a history: a variable which is given a new value keeps one row, of which `VALUE`, `DEFINED_UTC` and `DEFINED_BY_STATEMENT_ID` follow the most recent definition. The history of the definitions is available from `StatementExecutions`.
The following example lists the variables which the script set itself, most recently defined first:
```sql
select vre.name
, vre.value
, vre.origin
, vre.defined_utc
from Variables@script vre
where vre.origin = 'DEFINE'
order
by vre.defined_utc desc
```