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.
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot