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

Home -> Community -> Usenet -> c.d.o.server -> Re: Retrieving data without specifying table owner

Re: Retrieving data without specifying table owner

From: Gazza <garywaldrom_at_hotmail.com>
Date: Thu, 11 Nov 1999 16:06:42 -0000
Message-ID: <942336557.23894.0.nnrp-03.c1ed75d0@news.demon.co.uk>


CREATE PUBLIC SYNONYM Student FOR SystemOwner.Student

Jeff Van Dusseldorp <jeff.van_at_bigfoot.com> wrote in message news:lFBW3.4468$T4.1217661_at_news1.rdc1.on.wave.home.com...
> I'm working on the conversion of a SQL Anywhere database to Oracle. In
SQL
> Anywhere, if you select from a table name and don't specify the owner, it
> will still find the table as long as it is visible to you.
>
> Now, good programming technique would probably insist that you specify the
> table owner in each select anyway, but I'm left with miles of legacy code
> that didn't. If I can avoid rewriting each SQL script, it would make me
> happy.
>
> Is there anyway to make Oracle find the tables without specifying the
owner
> name.
>
> I'll give some pseudo-code examples below to describe my problem in more
> detail.
>
> ////////////////////////////////////////
> SQL Anywhere:
>
> GRANT CONNECT TO SystemOwner IDENTIFIED BY password;
> GRANT DBA TO SystemOwner;
> GRANT GROUP TO SystemOwner;
> CREATE TABLE SystemOwner.Student
> (
> Name CHAR(30)
> );
>
> GRANT CONNECT TO SampleUser IDENTIFIED BY password;
> GRANT DBA TO SampleUser;
> GRANT MEMBERSHIP IN GROUP SystemOwner to SampleUser;
>
> CONNECT SampleUser;
> SELECT * FROM Student;
>
> The select will return 0 rows (that's good).
>
> ////////////////////////////////////////
> Oracle:
>
> GRANT CONNECT TO SystemOwner IDENTIFIED BY password;
> GRANT DBA TO SystemOwner;
> CREATE TABLE SystemOwner.Student
> (
> Name CHAR(30)
> );
>
> GRANT CONNECT TO SampleUser IDENTIFIED BY password;
> GRANT DBA TO SampleUser;
>
> CONNECT SampleUser/password;
> SELECT * FROM Student;
>
> The following error will occur:
> ERROR at line 1:
> ORA-00942: table or view does not exist
>
>
>
> Thanks for reading. Any help would be appreciated
>
> Jeff Van Dusseldorp
> PlannSoft
>
>
Received on Thu Nov 11 1999 - 10:06:42 CST

Original text of this message

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