Creating SQL and XQuery templates

You can create SQL and XQuery templates to use when you type SQL and XQuery statements in the SQL and XQuery editor.

The template pattern can contain any valid SQL or XQuery clause or expression and can include variables. The variables from which you can choose are specific to the context of the pattern.

To create an SQL or XQuery template:

  1. Select Window > Preferences.
  2. In the Preferences window, select Data Management > SQL Development > SQL and XQuery Editor > Templates.
  3. On the Templates page, click New.
  4. In the New Template window, specify the name of the template and select whether you want an SQL or an XQuery template.
  5. If you want the template to be inserted automatically after you type its name in the SQL and XQuery editor and press Ctrl + Space, select the Automatically insert check box. The template name must be unique to automatically insert the template.
  6. Type a short description of the template.
  7. Type the template pattern. To add a variable at the insertion point, click Insert Variable, and then select the variable that you want in the pop-up window.
  8. Click OK. Your template is added to the list on the Templates page in the Preferences window.
  9. Click OK in the Preferences window.
The new template is now available for you to use in the SQL and XQuery editor.

Feedback