Defining SQL templates

Db2® for z/OS® Development tooling provides a set of SQL templates that you can add to scripts or stored procedures by using content assistance. You can also edit these templates or define more SQL templates in the Preferences window.

To see the SQL templates, open the Preferences window, and navigate to z/OS Solutions > Db2 for z/OS > Db2 Templates.

Use this page to add, edit, or remove SQL templates from Db2 for z/OS Development tooling content assistance. The templates in this list are included in the bottom half of the content assistance window, below the built-in functions and built-in stored procedures. This page includes SQL templates that are shipped with the product, but you can also create your own templates or remove templates that you do not need so that they do not appear in the content assistance window. Removed templates are not deleted; rather they are excluded from the content assistance window. When you select a template in the list its content is displayed in the Preview field.

This information is available for each template:

Name: How the template is identified in the content assistance window.

Context: Identifies the editor where the template is available. Db2 templates are available in the SQL editor.

Description: Text that is displayed beside the template name in the content assistance window.

Auto Insert: When this field displays on, the template is automatically inserted into a new source file.

Use the buttons beside the template list to do these actions:

New: Add a template.

Edit: Modify a selected template.

Remove: Remove the selected templates.

Restore Removed: Add the last template that was removed back to the list.

Revert to Default: Restore the list of templates to the default list.

Import: Import a template from an XML file.

Export: Export a selected template to an XML file.