SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Accessing tables of other users in SQL

Go down

Accessing tables of other users in SQL Empty Accessing tables of other users in SQL

Post by Micheal Sun Jan 31, 2010 12:34 am

Provided that a user has the privilege to access tables of other users (see also Section 3), she/he can refer to these tables in her/his queries. Let <user> be a user in the Oracle system and <table> a table of this user. This table can be accessed by other (privileged) users using the command
select  from <user>.<table>;

In case that one often refers to tables of other users, it is useful to use a synonym instead of <user>.<table>. In Oracle-SQL a synonym can be created using the command
create synonym <name> for <user>.<table> ;
It is then possible to use simply <name> in a from clause. Synonyms can also be created for
one’s own tables.

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum