Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: table from linked DB in from clause?
In article <SiKA6.1659$Kd5.65095_at_news0.telusplanet.net>, Glen A Stromquist
<stromqgl_at_alpac.ca> writes:
>Thought this would be simple...
>
>I want to pull data from 2 tables in 2 linked db's, my query looks like
>this:
>
>select a.filed1, b.field2
>from table1 a, table2_at_db2 b,
>where a.field = b.field
>
>
>obviously I am approaching this wrong, whats the right way?
>
>
>thanks in advance
>
You query is basically fine. You probably need to provide the remote table
owner for table2. If is much more convienent to access remote objects using
a synonym that specifies the remote owner.tablename_at_dblink.domain than
reference the link and domain in the query.
The connection user specified in the link or if none is specified the user running the query must have been granted the necessary DML privileges for the sql to work properly.
It is normal for the database link name to be the same as the NET 8 service name in the using clause, which in turn must match an entry in the tnsnames.ora file on the database server where the query is ran. But the link name can be different than the database name.
It normally helps to get an appropriate response if you post the actual Oracle errors you are getting. I hope I managed to cover whatever area is causing you a problem.
![]() |
![]() |