In Oracle we can create the public synonyms for the tables which users of other schema can refer to without specifying any schema name. Its an alternative name for data objects.
This is specifically useful when we are creating a generic script and do not want it to be schema specific.
For example the table called "employee" in the following query can be accessed without having to prefix the table name with the schema named testschema:
create or replace public synonym employee for testschema.employee ;
To drop the synonym use the following :
drop public synonym employee;
Synonyms can also be used for views, sequences, stored procedures, and other database objects.
This is specifically useful when we are creating a generic script and do not want it to be schema specific.
For example the table called "employee" in the following query can be accessed without having to prefix the table name with the schema named testschema:
create or replace public synonym employee for testschema.employee ;
To drop the synonym use the following :
drop public synonym employee;
Synonyms can also be used for views, sequences, stored procedures, and other database objects.
No comments:
Post a Comment