Previous Topic

Next Topic

Create Synonym

Valid in: SQL, ESQL, DBProc

The Create Synonym statement defines a synonym for a table, view, or index. A synonym is an alias (alternate name) for an object.

References to synonyms in applications are resolved to their base objects at runtime. References to synonyms in definitions of database procedures, views, and permissions are resolved at the time the procedure, view, or permission is defined. For this reason, the synonym must be valid at definition time and at runtime, but can be dropped and recreated in between.

Previous Topic

Next Topic

Syntax

The Create Synonym statement has the following format:

[EXEC SQL] CREATE SYNONYM synonym_name

              FOR [schema.]object

Previous Topic

Next Topic

Embedded Usage

You cannot use host language variables in an embedded Create Synonym statement.

Previous Topic

Next Topic

Permissions

All users are permitted to use this statement.

Previous Topic

Next Topic

Locking

The Create Synonym statement locks the iisynonym system catalog, and takes an exclusive lock on the table, view, or index for which a synonym is being created.

Previous Topic

Next Topic

Related Statements

Drop Synonym

Previous Topic

Next Topic

Examples: Create Synonym

The following are Create Synonym statement examples:

  1. Create a synonym for the authors table.

    create synonym writers for authors;

  2. Create a synonym for the composers table, owned by another user.

    create synonym cmp for tony.composers;


© 2007 Ingres Corporation. All rights reserved.