In addition to using predefined templates to enter SQL code, you can also create your own templates:
Select Window|Preferences from the Eclipse menu. The Preferences dialog appears.
From the left pane, select Sybase, Inc. and expand Database Development. Expand SQL Editor and choose templates to display a list of templates in the right pane.
Click New. The New Template dialog appears.
Alternatively, you can highlight a block of SQL statements in the SQL Editor, right-click, and select Save As Template to invoke the New Template dialog.
In the Name field, enter a name for the template. The name is used for selecting templates from the content assist options list. Duplicate template names are allowed. Use the description or context to distinguish duplicate template names.
From the Context drop-down menu, choose:
SQL if the template is to be used for all SQL code
SQL-ASA if the template is to be used only for ASA SQL code
SQL-ASE if the template is to be used only for ASE SQL code
SQL-ASIQ if the template is to be used only for ASIQ SQL code
SQL-ASE15 if the template is to be used only for ASE 15 SQL code
Replication Server if the template is to be used only for Replication Server SQL code
In the Description field, enter an optional description of the template.
The description displays after the template name in content assist.
In the Pattern field, enter the template text pattern. The pattern can include predefined and custom template variables. Click OK.
Variables are placeholders that allow you to enter different values each time you apply the template. Before a template is inserted into SQL Editor, variables in its pattern are evaluated, and its placeholders are replaced with evaluated values. Variables are of the form ${variable_name}.
To insert variables into your template:
Click Insert Variable or press Ctrl+Space to display a list of predefined variables. Select the variable you want to insert and double-click its name. The variable appears in the Pattern field.
To insert your own template variable, use ${variableName}, which evaluates to the name of the variable itself. Make sure that the name does not conflict with the name of any predefined template variable. If the dollar symbol appears as a literal, it must be escaped by using a second dollar sign or by using the variable ${dollar}.
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com