Databases Reference
In-Depth Information
Create variables at the database level
Using the
ALTER
command at the database level, we can create, edit, or delete
a variable.
Syntax
:
ALTER DATABASE APPLICATION-NAME.DATABASE-NAME ADD/SET/DROP
VARIABLE
•
VARIABLE-NAME
: Name of the variable
•
STRING
: Value for the variable
Example
:
• Create Variable:
alter database ESSCAR.ESSCAR add variable
'varAppDB''ESSCAR1';
• Edit Variable:
alter application ESSCAR set variable
'varAppDB''ESSCAR';
• Delete Variable:
alter application ESSCAR drop variable
'varAppDB';
Using Maxl, if you want to create a variable which has a double
quote in it, define it as shown below:
alter database 'ESSCAR'.'ESSCAR' add variable
'varDQ' '"TestDQ"';
Displaying the Substitution Variable and its value
To display a substitution variable, the
display
MaxL statement will be used.
Syntax
:
display variable
all
variable name
on application
APPLICATION-NAME
on database
DATABASE-NAME
on system
all
: Displays all existing substitution variables on the server.