Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    24

    Unhappy Unanswered: Help!! Cross database joining

    Guys/Gals,

    Please help !!! i want to use table A in DataBase 123 (DB123)join with table B in Database 456 (DB456), how can i do that?

    First, i tot i can create a view in Database 123 like this :

    CREATE VIEW Test_view AS
    SELECT *
    FROM DB456.TABLE_B

    but i give me "<eb1>SQL0204N "DB456.TABLE_B" is an undefined name. SQLSTATE=42704"

    any others way i can use without copying any table across DB coz i am not allowed to do so.

    Please help!!
    Hello

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Assuming you are on db2 luw ..

    Look into the federated database concepts ..

    a sample set of SQL

    create server sampsrv1 type db2/6000
    version 8.2 wrapper drda
    authorization "user1" password "pass1"
    options(
    dbname 'sam')

    @

    create user mapping for USER server sampsrv1 options
    (remote_authid 'user1', remote_password 'pass1')
    @

    create nickname a.systables for sampsrv1.syscat.tables @

    select * from a.systables @
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Mar 2004
    Posts
    24
    HI sathyaram_s,

    Thanks for your fast reply, i am using DB2 UDB 7.2 for Windows, after look at your sample SQL , not really understand, can you please explain further?? thanks ..

    act7656
    Hello

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Have you had a chance to look at the manuals ??
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  5. #5
    Join Date
    Sep 2004
    Posts
    111
    Look in to online redbook links for Information Integrator or DB2 Manual pages
    for federated db settings.

    Here is the four steps involved for this setup.
    1, Create wrapper
    2. Create server
    3. Create user mappings
    4. Create nicknames

    http://publib-b.boulder.ibm.com/Redb...7052.html?Open

    Thanks,
    Raj

  6. #6
    Join Date
    Mar 2004
    Posts
    24
    If let say the 2 different database is also resides in the same server in DB2 UDB 7.2, can i have a faster way to join this 2 table instead of appy the federated databse concept?

    Please comment, thanks .
    Hello

  7. #7
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    No, you still 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

Posting Permissions

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