Previous Topic

Next Topic

Drop Synonym

Valid in: SQL, ESQL

The Drop Synonym statement deletes one or more synonyms from a database. A synonym is an alias (alternate name) for a table, view, or index; synonyms are created using the Create Synonym

Dropping a synonym causes the DBMS Server to re-compile any repeat query or database procedure that references the alias. Dropping a synonym has no effect on views or permissions defined using the synonym.

When a table, view, or index is dropped (using the drop statement), all synonyms that have been defined for it are dropped.

Previous Topic

Next Topic

Syntax

The Drop Synonym statement has the following format:

[EXEC SQL] DROP SYNONYM [schema.]synonym_name {, [schema.]synonym_name};

Previous Topic

Next Topic

Embedded Usage

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

Previous Topic

Next Topic

Permissions

To drop a synonym that resides in a schema owned by the session's effective user, omit the schema parameter. To drop a synonym that resides in a schema owned by the session's effective group or role, specify the schema parameter.

Previous Topic

Next Topic

Locking

The Drop Synonym statement takes an exclusive lock on the object for which the synonym was defined.

Previous Topic

Next Topic

Related Statements

Create Synonym

Previous Topic

Next Topic

Example: Drop Synonym

The following example deletes a synonym for the authors table:

drop synonym writers;


© 2007 Ingres Corporation. All rights reserved.