Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Schema name in SQL statement

Re: Schema name in SQL statement

From: Daniel Ady Surya <Daniel.Surya_at_mincom.co.id>
Date: 22 Jan 1999 07:04:03 GMT
Message-ID: <01be45d5$ce50b960$9f0a13ac@DAS.mincom.co.id>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US