If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Database Connection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-02-04, 11:20
dsusendran dsusendran is offline
Registered User
 
Join Date: Apr 2004
Location: Inside Intel
Posts: 165
Question Database Connection

Hi all,

Is there a

Connect to <Database1>, <Database2> user <Admin> using <Password>; ??

TIA,

Newbie
Reply With Quote
  #2 (permalink)  
Old 06-02-04, 11:31
preetim preetim is offline
Registered User
 
Join Date: Jun 2003
Posts: 77
You can not connect to two databases in a single command. In one command window, the connection is only to one database at a time.
Reply With Quote
  #3 (permalink)  
Old 06-02-04, 11:38
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Not quiet ...

You may set CONNECT TYPE 2 and connect to more than one database in the same UOW ...
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 06-02-04, 11:44
dsusendran dsusendran is offline
Registered User
 
Join Date: Apr 2004
Location: Inside Intel
Posts: 165
Question Hmm...

The reason i wanted to do that was, I need to access tables across two databases whose schemas are different and the user accesses are different. Only a Admin can access both.

Database1 has a table TBLDB1 with DB1Col1, Db1Col2, Db1Col3
Database2 has a table TBLDB2 with DB2Col1, Db2Col2, Db2Col3

Where DB1Col1 = DB2Col1 (P.Key)

I need to access DB2Col2 and DB2Col3. Something like

Select DB2Col3, DB2Col2 from TBLDB2 where DB1Col1 = DB2Col1

Thanks,
Newbie
Reply With Quote
  #5 (permalink)  
Old 06-02-04, 12:09
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Federated Databases is something you'll need

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On