You can create SQL and XQuery templates to use when you type SQL
and XQuery statements in the SQL 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:
- Click .
- In the navigation tree of the Preferences window, expand the Data node
and the SQL Editor node, and then click Templates.
- On the SQL Editor - Templates page, click New.
- In the New Template window, specify the name of the template and
select whether you want an SQL or an XQuery template.
- If you want the template to be inserted automatically after you
type its name in the SQL editor and press Ctrl + Space, select the Automatically
insert check box. The template name must be unique
to automatically insert the template.
- Type a short description of the template.
- 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.
- Click OK. Your template is added
to the list on the SQL Editor - Templates page in the Preferences window.
- Click OK in the Preferences window.
The new template is now available for you to use in the SQL editor.