Description
You can use this statement to delete a synonym.
Syntax
DROP [PUBLIC] SYNONYM [ DATABASE. ]synonym;
Parameters
| Parameter | Description |
|---|---|
| PUBLIC | If PUBLIC is specified, the statement deletes public synonyms. If PUBLIC is not specified, the statement deletes private synonyms. |
| [ DATABASE. ]synonym | Specifies the database to which the synonym belongs. If the PUBLIC parameter is specified, the DataBase parameter does not need to be specified for synonyms, and the synonym parameter indicates the synonym name. |
Examples
- Deleting a synonym
obclient> drop synonym test.s1;
Query OK, 0 rows affected (0.03 sec)
- Deleting a PUBLIC synonym
obclient> drop public synonym syn_pub;
Query OK, 0 rows affected (0.02 sec)
Notes
Notice
- To delete a private synonym, ensure that the private synonym is in the corresponding database and that you have the DROP ANY SYNONYM privilege.
To delete a public synonym, you must have the DROP PUBLIC SYNONYM privilege.
To delete a public synonym, you must specify the PUBLIC keyword and must not specify the DataBase keyword.