Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Location
    London
    Posts
    25

    Unanswered: Queries accross two DB's

    DB2 Ver 8.

    Can we build Queries across two Databases. For ex : on two diff tables existing in two diff DB's.

    Table P1 in DB test1 and Table P2 in DB Test2. ?

    If so how ?

    I know of Federated DB's, but wondering is there any other way ?

    Thanks in advance,

  2. #2
    Join Date
    Aug 2003
    Location
    London
    Posts
    25
    Information which need to passed to the above ..

    This two db's on the Same platform. Win Platform..

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    If the two tables referenced are in the same SQL statement, you need federated support.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    Aug 2003
    Location
    London
    Posts
    25
    Thanks Marcus for the prompt reply..Am wondering is there anything other then federated DB support..like using alias can we build a query based on two different db's.




    Originally posted by Marcus_A
    If the two tables referenced are in the same SQL statement, you need federated support.

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    No, not if the two tables are in the same SQL statement. However, one can connect to two different databases in the same program, but you would need separate SQL statements to access them.

    When there is any chance that tables might need to be accessed in the same SQL statement, they should be in the same database, but perhaps different schemas if they need to be logically separated. Having two databases active on the same machine at the same time is not very efficient because it limits the amount of memory that can be used by any one database.
    Last edited by Marcus_A; 04-14-04 at 02:44.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •