Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / November 2005

Tip: Looking for answers? Try searching our database.

Query on tables from different DBs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Antanas - 15 Nov 2005 19:39 GMT
I have one table TABLE1 in X db, and another table TABLE2 in Y db.

When I execute the following:

CONNECT TO X;

SELECT * from TABLE1, TABLE2;

I get error:
SQL0204N  "TABLE2" is an undefined name.   SQLSTATE=42704

How can make this query work?
Larry - 15 Nov 2005 20:33 GMT
> I have one table TABLE1 in X db, and another table TABLE2 in Y db.
>
[quoted text clipped - 8 lines]
>
> How can make this query work?

You can only connect to one database at a time in DB2 and you must be
connected to a database in order to query a table in that database. The
only other option is to define a Federated database (a way to define one
logical database that has a "view" of other databases) and connect to
that federated database. See the DB2 doc at

http://www-306.ibm.com/software/data/db2/udb/support/manualsv8.html

in particular, the "Federated Systems Guide". You do not need to
purchase Information Integrator if you only want to access DB2 databases.

Larry Edelstein
Antanas - 16 Nov 2005 06:02 GMT
Thanks, Larry!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.