dbTalk Databases Forums  

Re: how to query between 2 remote databases

comp.databases.oracle.server comp.databases.oracle.server


Discuss Re: how to query between 2 remote databases in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TurkBear
 
Posts: n/a

Default Re: how to query between 2 remote databases - 07-02-2003 , 11:00 AM






"kiran" <kiran.news.invalid (AT) web2news (DOT) net> wrote:

Quote:
How to query on two tables that are on two different remote database
with a join.

s *
f tb1@uid/pass (AT) db1 (DOT) world a, tb2@uid/pass (AT) db2 (DOT) world b
w a.col1 = b.col2

but this does not work, any idea ?

Thanks
Does not work, how?

Also OS, version, etc would be a nice touch..




Reply With Quote
  #2  
Old   
Karsten Farrell
 
Posts: n/a

Default Re: how to query between 2 remote databases - 07-02-2003 , 11:40 AM






kiran was kind enough to write:
Quote:
How to query on two tables that are on two different remote database
with a join.

s *
f tb1@uid/pass (AT) db1 (DOT) world a, tb2@uid/pass (AT) db2 (DOT) world b
w a.col1 = b.col2

but this does not work, any idea ?

Thanks


I think you need to define "does not work" since this pattern should
work except for the fact that it won't know what the star means -- all
the columns from tb1 or tb2?
--
[:%s/Karsten Farrell/Oracle DBA/g]


Reply With Quote
  #3  
Old   
Brian Peasland
 
Posts: n/a

Default Re: how to query between 2 remote databases - 07-08-2003 , 01:28 PM



When you create the db link, specify a userid and password in the link
definition. This makes the userid/password in the FROM clause
unnecessary.

HTH,
Brian

kiran wrote:
Quote:
I do have a dblink between the two remote databases,which I am using in
my query userid/ password followed by dblink

Thanks
Kiran

Tim X wrote:
"kiran" == kiran <kiran.news.invalid (AT) web2news (DOT) net> writes:

kiran> How to query on two tables that are on two different remote
kiran> database with a join.

kiran> s * f tb1@uid/pass (AT) db1 (DOT) world a, tb2@uid/pass (AT) db2 (DOT) world b w
kiran> a.col1 = b.col2

kiran> but this does not work, any idea ?

kiran> Thanks

Read up about database links. You need to create a db link and then
use the syntax
select ....
from table@dblink_name
....

--
Direct access to this group with http://web2news.com
http://web2news.com/?comp.databases.oracle.server
--
================================================== =================

Brian Peasland
dba (AT) remove_spam (DOT) peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
the three"


Reply With Quote
  #4  
Old   
Jeff W
 
Posts: n/a

Default Re: how to query between 2 remote databases - 07-10-2003 , 03:34 PM



You don't need the username and password in the FROM clause. Reference the
table@databaselink_name in the FROM clause. When you create the database
link, you should be creating it using a username and password already.

Thanks.

"kiran" <kiran.news.invalid (AT) web2news (DOT) net> wrote

Quote:
I do have a dblink between the two remote databases,which I am using in
my query userid/ password followed by dblink

Thanks
Kiran

Tim X wrote:
"kiran" == kiran <kiran.news.invalid (AT) web2news (DOT) net> writes:

kiran> How to query on two tables that are on two different remote
kiran> database with a join.

kiran> s * f tb1@uid/pass (AT) db1 (DOT) world a, tb2@uid/pass (AT) db2 (DOT) world b w
kiran> a.col1 = b.col2

kiran> but this does not work, any idea ?

kiran> Thanks

Read up about database links. You need to create a db link and then
use the syntax
select ....
from table@dblink_name
....

--
Direct access to this group with http://web2news.com
http://web2news.com/?comp.databases.oracle.server



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.