Global Variables
Global variables can be used to simplify complex parameters. For example, long and difficult variables can be replaced to improve the readability of SQL statements.
Creating Variables
- In the navigation pane of the DLI console, click Global Variables.
- On the Global Variables page, click Create in the upper right corner to create a global variable. Figure 1 Creating a global variable
Table 1 Parameters description Parameter
Description
Variable
Name of the created global variable.
Value
Global variable value.
- After creating a global variable, use {{xxxx}} in the SQL syntax to replace the parameter value set as the global variable. xxxx indicates the variable name. For example, in the table creation statement of DWS datasource connection, set the value dbadmin.customer of the dbtable parameter to the global variable abc. You can use {{abc}} to replace the actual variable value.
CREATE TABLE 'dws_test_var' USING dws OPTIONS ( 'url''****', //Set the URL based on the site requirements. 'dbtable' '{{abc}}', 'user' 'dbadmin', 'password' '123' )
Modifying Variables
On the Global Variables page, click Modify in the Operation column of a variable to modify the variable value.
Deleting Variables
On the Global Variables page, click Delete in the Operation column of a variable to delete the variable value.
- Only the user who creates a global variable can delete the variable.
- After a variable is deleted, the variable cannot be used in SQL statements.
Last Article: Global Configuration
Next Article: Service Authorization
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.