Creating and Editing Synonyms

From ER/Studio Data Architect
Jump to: navigation, search

Go Up to Creating and Editing Database Dependent Objects

A synonym is an alternate name for a database object that lets you:

  • Reference an object without specifying its owner (The synonym definition references the owner, but to use the synonym thereafter you do not have to know the owner name.)
  • Reference a remote object without specifying its database.
  • Alias an object so its purpose becomes more obvious.

The following database platforms support Synonyms:

  • IBM DB2 for OS/390 5.x and 6.x, and for z/OS 7.x, 8.x, 9.x, and 10x
  • Microsoft SQL Server 2005, 2008, 2012, 2014, 2016
  • Netezza 4.6 and 5.0
  • Oracle 8.x, 9i, 10g, 11g and 12c

Notepad blue icon 2.pngNote: The Synonym Wizard and Synonym Editor share the same options, except for Attachment Bindings options which are present only in the editor.

Create a Synonym

  1. In the Data Model Explorer, expand the Physical Main Model, right-click the Synonyms node, and then select New Synonym.
  2. Complete the Synonyms Wizard and then click Finish to create the synonym.

Tip:Once you have created the synonym, you can edit it by right-clicking the synonym you want to change, and then clicking Edit Synonym.

  • The options available depend on the database platform selected.

Name page/tab

  • Make this synonym accessible to all users? If selected, creates a public synonym that can be used by everyone in the database, otherwise a private synonym is created that belongs to the synonym owner.

Reference page/tab

  • What type of object does this synonym reference? The list of objects available depends on the selected database platform.
  • IBM DB2 for OS/390 5.x and 6.x, for z/OS 7.x, 8.x, 9.x, 10.x, and 11.x: Supports synonyms for aliases, synonyms, tables, unknown, and views.
  • Microsoft SQL Server 2005 and 2008: Supports synonyms for functions, procedures, and views.
  • Microsoft SQL Server 2012, 2014, and 2016: Supports synonyms for sequences.
  • Netezza 4.6 and 5.0: Supports synonyms for tables and views.
  • Oracle 8.x, 9i, 10g, 11g and 12c: Supports synonyms for functions, materialized views, object types, packages, procedures, sequences, synonyms, tables, and views.
  • If you specify Unknown, the object type will change to correspond to the type of object named below.
  • What is the schema of the referenced object? What is the name of the referenced object? The list is populated with the names of all the objects in the model matching the model type specified as the type of object. But you can also enter your own value in this field.
  • Who is the owner of the referenced object? What is the name of the referenced object? The list is populated with the names of all the objects in the model matching the model type specified as the type of object. But you can also enter your own value in this field.
  • If the object is on a remote database, please enter the DB link. Type the path of the remote database, or click the list and select it.

Definition page/tab

Enter or edit a definition for the synonym. If the target database supports it, ER/Studio Data Architect adds this definition as a comment when generating SQL code.

DDL page/tab

Displays the CREATE SYNONYM statement needed to build the synonym. In physical models, ER/Studio Data Architect uses the platform-specific parser of the model's selected database platform to generate the view. If you're adding a view to a logical data model, the default parser AINSI SQL is used unless you change the View Parser in the Logical Model Options to another parser. For more information, see Defining Model Options for the Selected Model.

Attachment Bindings tab

The Attachment Bindings tab is available in the Synonym Editor. Bind an external piece of information, or attachment to the synonym. You can also remove an attachment from an object, override an attachment binding's default value, or change the position of a bound attachment. To override the value of the attachment you have moved to the Selected Attachments grid, double-click the Value field of the target attachment. ER/Studio Data Architect opens the Value Override Editor or a list depending on the attachment datatype. Attachments are created in the Attachments folder of the Data Dictionary. For more information, see Attaching External Documents to the Data Model.

See Also