Creating a New Template

Create a new SQL template for use when creating procedural objects

  1. Select Window > Preferences.
  2. In the left pane, select Sybase, Inc. and expand Database Development.
  3. Expand SQL Editor and choose Templates to display a list of templates in the right pane.
  4. Click New.
  5. 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.

  6. From the Context drop-down menu, select the most appropriate option.
    Select If the template is to be used for
    Data Federation Only for Data Federation code
    SQL All SQL code
    SQL Anywhere Only for SQL Anywhere SQL code
    SQL-ASE Only for ASE SQL code
    SQL-IQ Only for Sybase IQ SQL code
    SQL-ASE15 Only for ASE 15 SQL code
    Replication Server Only for Replication Server SQL code
  7. (Optional) In the Description field, enter a description of the template.

    The description displays after the template name in content assist. This description differentiates templates with the same name.

  8. In the Pattern field, enter the template text pattern.

    The pattern can include predefined and custom template variables.

  9. (Optional) Select Insert Variable to display a list of predefined variables, and then select the variable you want to insert and double-click its name.

    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 ${apply the template variable_name}.

    The variable appears in the Pattern field.

  10. (Optional) Create your own template variable by using ${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}.

  11. Click OK.
Related concepts
Content Assist
SQL Templates
Intelligent Templates
Related tasks
Inserting Predefined SQL Code Using a Template
Using an Intelligent Template

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.