DLI allows you to create custom templates or save currently used SQL statements as templates for quick and convenient SQL operations. Once a template is saved, you can execute SQL operations directly through the template without the need to write SQL statements.
SQL templates include sample templates and custom templates. The default sample template contains 22 standard TPC-H query statements, which can meet most TPC-H test requirements. For details, see TPC-H Sample Data in the SQL Templates Preset on DLI.
In the navigation pane on the left, choose Job Templates > SQL Templates. In the upper right corner of the displayed page, click Settings. In the displayed Settings dialog box, choose whether to display templates by group.
If you enable Display by Group, the display options are Expand the first group, Expand all, and Collapse all.
You can create a template on either the Job Templates or the SQL Editor page.
Enter the template name, SQL statement, and description information. For details, see Table 1.
Parameter | Description |
|---|---|
Name | Indicates the template name.
|
Statement | SQL statement to be saved as a template. |
Description | Description of the template you create. |
Group |
|
Group Name | If you select Use existing or Use new, you need to enter the group name. |
Enter the template name, SQL statement, and description information. For details, see Table 1.
Perform the template operation as follows:
On the SQL Templates page, you can enter the template name keyword in the search box on the upper right corner to search for the desired template.
Only custom templates can be modified. To modify a template, perform the following steps:
On the SQL Templates page, select one or more templates to be deleted and click Delete to delete the selected templates.