Chapter 5: SQL Statements
5.8 DROP SYNONYM
Description
Drops the specified synonym.
Syntax
DROP [PUBLIC] SYNONYM [owner_name.]synonym ;
Arguments
PUBLICSpecifies that the synonym was created with the PUBLIC argument.
SQL generates the Base table not found error if DROP SYNONYM specifies PUBLIC and the synonym was not a public synonym. Conversely, the same error message occurs if DROP SYNONYM does not specify public and the synonym was created with the PUBLIC argument.
To drop a public synonym, you must have the DBA privilege.
owner_nameIf owner_name is specified and is different from the name of the user executing the statement, then the user must have DBA privileges.
synonymName for the synonym.
Example
DROP SYNONYM customer ; DROP PUBLIC SYNONYM public_suppliers ;
Authorization
Users executing DROP SYNONYM must have either the DBA privilege or be the owner of the synonym. Users executing DROP PUBLIC SYNONYM must have the DBA privilege.
- SQL Compliance
Extension
- Environment
Embedded SQL, interactive SQL, ODBC applications
CREATE SYNONYM