Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    1

    Unanswered: Copying a DB2 table to another server programmatically

    Hi
    what is the best way to copy a DB2 table to another server (DB2 too for a start) programmatically? I did some research on CLI, it is pretty easy to copy a table inside the same server, like:
    insert into table2 select * from table1

    but I couldn't find anything except for manually fetching record by record and inserting it to the destination table.

    Thanks in advance

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Look at Federation ... You can refer to remote tables as nicknames and copy the data across using Cursor Load

    Say you want to copy data from table t10 in db test1db to t100 in db test2db ..

    In test2db, define test1db's t10 as nickname -- say test1db.t10

    declare c1 cursor for select * from test1db.t10
    load from c1 of cursor insert into t100
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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