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. Enter the template Name.

    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. Select a Context.
    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) Enter a Description.

    The description displays after the template name in Content Assist. This description differentiates templates with the same name.

  8. 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 from Using a Template into a Routine Object
Using an Intelligent Template


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com