Parameter configuration

更新时间: 2026-01-17 20:51:50

Through parameter configuration, you can assign values to parameter variables used in SQL code in Notebooks or SQL queries. When the SQL code runs, parameter variables are automatically replaced with their corresponding values. This topic describes how to configure parameters.

Procedure

The following procedure uses SQL query as an example. The parameter configuration paths for Notebook and SQL query tasks are the same.

  1. In the top menu bar of the Dataphin homepage, select Analysis > SQL Query/Notebook.

  2. In the SQL query list, select the target task for which you want to configure parameters. In the editing area of the task, click the image..png icon at the top to enter the Parameter Checking dialog box.

  3. In the Parameter Checking dialog box of the property panel, configure the parameter information for the task.

    Field

    Description

    Data Source Mode

    Data source SQL queries support configuring the data source mode. If the data source is in Dev-Prod mode, you can select Development or Production; if the data source is in Basic mode, you can only select Production.

    Important

    If you select Production, executing the statement will change the data in the production environment. Please operate with caution.

    Parameter Name

    The parameter name is the variable name you defined in your SQL code. In SQL, you can add parameters using expressions, and the system will automatically load existing parameters from the SQL. Expression format: ${variable_name}.

    Parameter Type

    Click the Parameter Type drop-down list to modify the parameter type. Types include Global Variable, Workspace Name Variable, Local Variable, Cross-node Variable, and Non-variable Type. For more information, see .

    After selecting multiple parameters or clicking Select All, click Modify Parameter Type at the bottom of the parameter list to batch modify parameter types.

    Note
    • For data security reasons, global variables of account password type cannot be used here and will be treated as local variables that require manual value assignment.

    • If you reference a global variable with permission control enabled, the system will automatically verify whether the current user has permission. Global variables without permission will be marked with an image icon. You can click Request Permission to jump to the Permission Management > Variable Permission Management page to request permission.

    • Workspace name variables are not supported in the analysis platform. If variable_name matches the name of a production project or production module, it will be treated as a local variable.

    Parameter Value

    Enter the parameter value to replace the variable. The maximum length is 256 characters, and empty values are supported. You can also perform calculations on date and time. For specific operations, see .

    Actions

    Supports converting to local variables and ignore operations.

    • Convert to local variable: During parameter configuration, if your variable name matches a global variable name, the system will prioritize it as a reference to the global variable. You can click the Actionsimage icon in the column of the corresponding parameter

    • Ignore: If ${variable_name} in your code is part of the code content rather than a variable, you can click the Actionsimage icon in the column of the corresponding parameter to ignore this variable.

  4. Click OK.

    Important

    When running a single SQL query, you only need to configure parameters that have not been configured in the current SQL. The configured values will take effect globally in that task.

上一篇: Create a manual table 下一篇: View and manage analysis platform tables
阿里云首页 智能数据建设与治理 Dataphin 相关技术圈