RE: Accessing data from different database on different location

RE: Accessing data from different database on different location

 

  

Yes, it is possible using 'nick names' ...here are the steps

1. Connect to source database
2. Create server mapping ( command: 'create server' command)
3. Create user mapping ( command : 'create user mapping' )
4. Create nick name ( command : 'create nickname' )

Now you could join a table in the source table with the nick name.....hope
this helps.

Suresh.




"Kaushal Anand " <db2udbdba-ezmlmshield-x3284491.[Email address protected]

07/28/2006 08:05 AM

To
"LazyDBA Discussion" <[Email address protected]
cc

Subject
RE: Accessing data from different database on different location






Hi,

I've come across a few links that suggest that it might be possible. Not
sure about DB2 though. There is sample code that says how to connect to
two databases. And there's some evidence to support that you can fetch
data from two sources. I'm not sure. I'll give you the links. It'll be
great if you can find something.

http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb
.doc/ad/samples/c/s-dbmcon-sqc.htm
http://www.databasejournal.com/features/mssql/article.php/1442101 (look
at the sample code)
http://forum.java.sun.com/thread.jspa?threadID=171905


-----Original Message-----
From: Jitendra Kumar Prajapati
[mailto:db2udbdba-ezmlmshield-x68231816.[Email address protected]
Sent: Friday, July 28, 2006 5:35 PM
To: LazyDBA Discussion
Subject: Accessing data from different database on different location


Hi DBAs,



I've joined LazyDBA once again.



I have two different databases on two different locations and I want to
query data from both the database servers.



Select * from db1.tab1 tab1, db2.tab2 tab2

Where tab1.col1 = tab2.col1;





So, kindly advise me the better way to achieve it.



Any help would be highly appreciated.



Thanks and Regards,

Jitendra Kumar Prajapati











========================================================================
====================================================

Tech Mahindra, formerly Mahindra-British Telecom.

Disclaimer:

This message and the information contained herein is proprietary and
confidential and subject to the Tech Mahindra policy statement, you may
review at <a
href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahind
ra.com/Disclaimer.html</a> externally and <a
href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahind
ra.com/Disclaimer.html</a> internally within Tech Mahindra.

========================================================================
====================================================


---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html





---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



CONFIDENTIALITY NOTICE:
This is a transmission from Kohl's Department Stores, Inc.
and may contain information which is confidential and proprietary.
If you are not the addressee, any disclosure, copying or distribution or use of the contents of this message is expressly prohibited.
If you have received this transmission in error, please destroy it and notify us immediately at 262-703-7000.

CAUTION:
Internet and e-mail communications are Kohl's property and Kohl's reserves the right to retrieve and read any message created, sent and received. Kohl's reserves the right to monitor messages by authorized Kohl's Associates at any time
without any further consent.


DB2 & UDB email list listserv db2-l LazyDBA home page