Importing SQL and XQuery templates

In addition to adding new templates by using the New Template window, you can import existing SQL and XQuery templates through the SQL Editor - Templates page of the Preferences window.
You can import into your workbench SQL and XQuery templates that members of your team create in their workbench and then export. The XML file that contains the exported SQL and XQuery templates has the following syntax. If the file contains more than one template, each template is represented by one <template> element.
<?xml version="1.0" encoding="UTF-8"?>
<templates>
   <template autoinsert="false" context="sql" deleted="false"
             description="your_template_description" enabled="true"
             name="your_template_name">your_template_pattern</template>
</templates>
The value for the autoinsert attribute can be true or false. The value for the context attribute is sql or xquery, depending on the type of template that was exported.

To import an SQL or XQuery template:

  1. Click Window > Preferences.
  2. In the navigation tree of the Preferences window, expand the Data node and the SQL Editor node, and then click Templates.
  3. On the SQL Editor - Templates page, click Import, and then browse to and select the file that contains the template that you want to import. The template in the imported template file is added to the list of templates on the SQL Editor - Templates page
  4. Click OK in the Preferences window.
The imported template is available in your workbench for you to use in the SQL editor.
Related tasks
Exporting SQL and XQuery templates
Related reference
Preferences window - SQL Editor - Templates page

Feedback