Creating and Dropping a Synonym With SQL

Previous
Previous
Next
Next

Example: Creating a Synonym Using SQL shows how to create a synonym that is an alias for the employees table. For more information about synonyms, see "Managing Synonyms".

Creating a Synonym Using SQL

-- create a synonym for the employees table
CREATE SYNONYM emps for HR.employees;

-- query the employees table using the emps synonym
SELECT employee_id, last_name FROM emps WHERE employee_id < 105;

Example: Dropping a Synonym Using SQL show how to drop a synonym.

Dropping a Synonym Using SQL

-- drop the synonym
DROP SYNONYM emps;


For information about creating and dropping a synonym with the Object Browser page, see "Creating a Synonym" and "Dropping a Synonym".