Using Variables in a Synonym

The Synonym Editor allows you to define variables in a synonym to specify synonym attributes, such as the connection name or the table name. For an example of how variables in a synonym can be used, see Iterating Through Multiple Tables.

Add a Variable to a Synonym

    Procedure
  1. Right-click an object in the Synonym Editor, point to Insert, and then click Variable.
  2. A new folder named Variables is added to the object tree, with &&VARIABLE1 as an entry. The Properties pane shows the attributes of the variable, as shown in the following image.

  3. If desired, change the name of the variable and enter a default value in the appropriate fields.

Add a Variable for an Attribute

Attributes in a synonym that can be specified with a variable are identified with an attribute name in blue, as shown in the following image.

Properties pane

To add variables for an attribute:

    Procedure
  1. Right-click the attribute in the Properties pane and click Parameterize Value.
  2. Expand the Variables folder. A variable with a name that combines the synonym name with the variable name has been added.
  3. Click the variable name to assign values, as shown in the following image.