Query two tables from different schema

Posted by Guru on Stack Overflow See other posts from Stack Overflow or by Guru
Published on 2009-06-11T11:38:05Z Indexed on 2010/05/31 1:22 UTC
Read the original article Hit count: 246

Filed under:
|

Hi-

I have two different schemas in Oracle (say S1, S2). And two tables in those schemas(say S1.Table1, S2.Table2). I want to query these two tables from schema S1.

Both S1 and S2 are in different databases. From DB1 - Schema S1, I want to do something like this,

select T1.Id
  from S1.Table1 T1
     , S2.Table2 T2 
 Where T1.Id = T2.refId

I know one way of doing this would be creating a DB Link for the second schema and use it in querying. But sadly, I don't have priv to create DB link. Is there some way to do without DB link, like, in TOAD, you can compare two schema objects. But again, two schema objects and it is general comparision. Not like querying them.

Any ideas, suggestions are greatly appriciated. Thanks in advance.

© Stack Overflow or respective owner

Related posts about database

Related posts about Oracle