Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Teradata Synonyms

Tags: object synonym
Simplify access to objects by creating a Synonym (another name for an object). With synonyms, you can:
• Ease referring to a table owned by another user
• Shorten lengthy object names

CREATE [PUBLIC] SYNONYM synonym FOR object; -- only DBA can drop a public synonym.

To refer to a table owned by another user, you need to prefix the table name with the name of the user who created it followed by a period. Creating a synonym eliminates the need to qualify the object name with the schema and provides you with an alternative name for a table, view, sequence,
procedure, or other objects. This method can be especially useful with lengthy object names, such as views.

Guidelines
• The object cannot be contained in a package.
• A private synonym name must be distinct from all other objects owned by the same user.

• Create a shortened name for the DEPT_SUM_VU view. ---- CREATE SYNONYM d_sum FOR dept_sum_vu;
• Drop a synonym. ---- DROP SYNONYM d_sum;
In the Oracle server, the DBA can specifically grant the CREATE PUBLIC SYNONYM privilege to any user, and that user can create public synonyms.


This post first appeared on Teradata SQL Reference, please read the originial post: here

Share the post

Teradata Synonyms

×

Subscribe to Teradata Sql Reference

Get updates delivered right to your inbox!

Thank you for your subscription

×