Synonym Nodes

This section covers the following topics:

How Synonym Nodes Work

The Synonym node is a child of the Synonyms node. It represents a synonym object in the database. Each Synonym node has a read-only child node that represents the target of the synonym for this schema. For example, suppose the EMP_SYN synonym points to the EMP table; this synonym will have an EMP Table node as its child. However, if Server Explorer does not support the schema object to which this synonym points, the synonym will not have a child node. The synonym itself is read-only.

If the synonym points to an object over a database link, the child synonym node will be a special database link node (DBlink). This node has the standard properties and menu items. The node is named using the following syntax:

schema.object@dblink_name

Starting with Visual Studio 2005, you can edit the name of the synonym in place by selecting the name and then clicking it to open an edit box or by choosing the Rename menu option to open the edit box.

Note: This feature only works in Visual Studio 2005.

To perform actions on the Synonym node: right-click the node and from the menu, choose the appropriate command. To view the node's properties, select the node and/or click Properties in the node's menu.

Menu Options

Menu Option Description

Edit

Edits an existing synonym using the Synonym Designer. Alternatively, double-clicking a synonym node opens the Synonym Designer for that synonym.

Query Window

Opens the Query Window so that you can execute SQL and PL/SQL queries from Visual Studio.

Generate Create Script

Writes the synonym definition to a .sql file

Generate Create Script to Project

Generates the synonym definition to a .sql file and adds the .sql file to an open Oracle Database Project.

If multiple objects in Server Explorer are selected, a master SQL script is created in the Oracle Database Project Scripts folder. This master script contains calls to individual child SQL scripts (one for each schema object) generated into the various schema object folders and this master script is ordered with dependencies taken into consideration.

If there are multiple open Oracle Database projects, Visual Studio prompts you to select the project to add the script to.

This operation can also be performed by dragging and dropping the Server Explorer node(s) directly onto a database project folder.

See Managing Oracle Script Files for more information.

Note: Oracle Database Project Version 2 projects are not supported. To add scripts to this project type, use Import Schema or Add Existing Item menu items on an Oracle Database Project Version 2 project folder, or use the Schema Compare tool.

Dependencies and References

Opens the Dependencies and References Viewer for viewing the dependencies that this object has on other database schema objects.

Privileges

Opens the Grant/Revoke Privileges dialog box.

Delete

Drops the synonym and its child nodes.

Rename

Allows you to edit the Synonym name in place in Server Explorer. Alternatively, you can select the Synonym name and then click one more time to open an edit box.

Refresh

Updates the Synonym node tree, including its associated synonyms nodes.

If the database object associated with the node was deleted from the database, you will be asked if the node needs to be deleted from the Server Explorer.

Properties

Displays the Properties window.