![]() | |
All SQL Workbench/J specific command can only be used from within SQL Workbench/J |
More details about using variables can be found in the chapter Variable substitution.
This defines an internal variable which is used for variable substitution during SQL execution.
There are two possibilities to define a variable.
The short syntax is: WbVarDef variable=value
The long syntax allows to define variables in a different way:
WbVarDef
supports conditional execution
Parameter | Description | |||
---|---|---|---|---|
-variable | The name of the variable to be defined. | |||
-value | The value of the variable. | |||
-file | Read the variable definitions from the specified file. | |||
-contentFile | Read the contents of the variable from a the specified file. | |||
-encoding |
The encoding of the file specified with -contentFile .
| |||
-query | Define a SQL query to be used as the source for the variable(s). | |||
-replaceVars |
Valid values are:
If the variable content is defined through
The default for this parameter is: | |||
-cleanupValue |
Valid values are: If this is set to true, the value is "cleaned" up such that newlines (linefeeds) and SQL style comments are removed.
The default for this parameter is: | |||
-removeUndefined |
Valid values are:
If this is set to true, any reference to non-existing variables inside the value to be defined
through
The default for this parameter is: | |||
-nullHandling |
Define how NULL values returned from a SQL query should be handled.
| |||
-values | Define a comma separated list of values that are used in the dialog that is shown when prompting for variable values. | |||
-silent |
If the option -silent is specified, no feedback about the variable definition
will be shown.
|
More details and examples can be found in the chapter: Variable substitution
This removes a variable.
The syntax is WbVarDelete variable
variable
is the name of the variable to be removed.
The name can contain wildcards. WbVarDelete *
will remove all defined variables.
WbVarDelete id*
will remove all variables starting with id
.
This shows all defined variables when invoked without parameters. There are two ways to filter the result:
Supplying a simple wildcard value, e.g. WbVarList foo*
to display variables where the name starts with foo
Using the parameter -match
to define a regular expression only show variables where the name matches the regular expression,
e.g. WbVarList -match="^(foo|bar).*"
to list all variables where the name starts with foo
or bar
.