Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Schema name in SQL statement
Omer Eisenberg <omereis_at_nist.gov> wrote in article
<36A73A00.EDE67E26_at_nist.gov>...
> Hi All,
> I'm quite new to Oracle, so forgive me if this question is silly.
> The only way I found for one user, say USER1, can access tables and
> views owned by another users, say USER2, is to put the schema name in
> the SQL statement, e.g.:
> SELECT * FROM USER2.TABLE1
> Am I right about this, or is there a way to avoid including the schema
> name?
Right. But User1 must have a privilege (SELECT or SELECT ANY TABLES). If you want to omit schema, you can create synonym for that table. eg: create synonym tblusr2 for user2.table1;
create public synonym tblusr2 for user.table1;
Now, You can access user2.table1 without the schema name:
SELECT * FROM TBLUSR2;
> Thanks in advance,
> Omer Eisenberg.
>
>
>
Daniel AS
IT Consultant(DBA)
Received on Fri Jan 22 1999 - 01:04:03 CST
![]() |
![]() |