Question

How can one copy data from one database to another database in DB2...?

In Oracle one can do this by creating database links as below

create public database link remote using 'orcl222'

where orcl222 is the source database

INSERT INTO test_rowid (ID, NAME)
SELECT ID, NAME    
FROM rsext.test_rowid@remote

Can someone please tell me how can i do this in DB2?

Was it helpful?

Solution

You can use several methods:

  • Export / LOAD or IMPORT
  • Use federation to create a wrapper and a nickname, and then just perform an insert select. (Needs special license)
  • Writing an external Stored Procedure (C or Java) that connects to the remote database.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top