Parameter settings allow you to assign values to parameter variables in the SQL code of a Notebook or SQL query. When the SQL code runs, the parameter variables are automatically replaced with their assigned values. This topic describes how to configure parameters.
Procedure
The following steps use an SQL query as an example. The procedure for configuring parameters is the same for both Notebook and SQL query nodes.
On the Dataphin home page, in the top menu bar, choose Analysis > SQL Query or Notebook.
In the SQL query list, select the target task and click the
icon at the top of the editing area to open the Parameter Settings dialog box.In the Properties panel, you can configure the task parameters in the Parameter Settings dialog box.
Field
Description
Data source mode
SQL queries support data source mode configuration. If the data source is in Dev-Prod mode, you can select Development or Production. If the data source is in Basic mode, only Production is supported.
ImportantIf you select Production, executing the statement will change data in the production environment. Proceed with caution.
Parameter name
The parameter name is the variable name defined in the SQL code. Add new parameters in SQL using expressions. The system automatically loads existing parameters from the SQL code. Expression format:
${variable_name}.Parameter type
Click the Parameter type drop-down list to change the parameter type. Types include Global Variable, Namespace Variable, Local Variable, Cross-node variable, and Non-variable type. For more information, see Parameter name.
Select multiple parameters or select All. Then, click Modify Parameter Type at the bottom of the parameter list to change the types in a batch.
NoteFor data security, global variables of the account and password type cannot be used here. They are treated as local variables and require manual value assignment.
If you reference a global variable with permission management enabled, the system automatically checks if the current user has permission. Global variables for which you do not have permission are marked with the
icon. Click Request Permission to go to the Permission Management > Variable Permission Management page to request permission.Workspace name variables are not supported in the analysis platform. If a
variable_namematches the name of a production project or production section, it is treated as a local variable.
Parameter value
Enter the value to replace the parameter variable. The maximum length is 256 characters. Empty values are supported. You can also perform calculations on date and time values. For more information, see Variable assignment
Actions
Actions include converting to a local variable and ignoring.
Convert to Local Variable: If a variable that you are configuring has the same name as a global variable, the system treats it as a reference to the global variable by default. You can click the
icon in the Actions column for the parameter to convert its type to a local variable or convert a local variable to a global variable.Ignore: If the
${variable_name}in your code is part of the code content and not a variable, you can click the
icon in the Actions column for the corresponding parameter to ignore the variable.
Click OK.
ImportantWhen running a single SQL statement, you only need to configure its unconfigured parameters. The configured values take effect globally within the node.