Description
This statement deletes a synonym.
Syntax
DROP [PUBLIC] SYNONYM [ schema. ]synonym;
Parameter description
| Parameter | Description |
|---|---|
| PUBLIC | Specify PUBLIC to delete a public synonym. If you do not specify PUBLIC, a private synonym is deleted. |
| [ schema. ]synonym | The schema field specifies the schema to which the current synonym belongs. If PUBLIC is specified, you do not need to specify the schema field for the synonym. The synonym field specifies the name of the synonym. |
Examples
- Delete a synonym.
OceanBase(TEST@TEST)>drop synonym test.s1;
Query OK, 0 rows affected (0.04 sec)
- Delete a public synonym.
OceanBase(TEST@TEST)>drop public synonym syn_pub;
Query OK, 0 rows affected (0.03 sec)
Considerations
- When you delete a synonym, you must have the following permissions:
- When you delete a public synonym, you must specify the PUBLIC keyword and do not specify the schema.