473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Insert from table in DB A to table in DB B

Hi

I know this is a stupid question but I am quite new to DB2. I need to copy data from a table in Database A to a table in Database B, the table in DB B already contains data I just want add to it. Can anyone help me with a query on how to achieve this I dont want to use the "Load Utility".

Thanks very much.
Feb 5 '08 #1
3 1453
docdiesel
297 Expert 100+
Hi,

there's no way to move data directly from DB A to DB B in DB2. You'll have to export the data from A and load or import it into B. Maybe you'd like to use a pipe/fifo if your DB2 is at home on Linux/Unix. That way you won't have to write and read an IXF file to disk.

Regards,

Bernd

----

Expand|Select|Wrap|Line Numbers
  1. mkfifo /path/to/myfifo
  2.  
  3. db2 connect to A
  4. db2 export to /path/to/myfifo of IXF select * from ...
  5.  
  6. and meanwhile on another shell:
  7.  
  8. db2 connect to B
  9. db2 load (or import) from /path/to/myfifo of IXF insert into ...
  10.  
Feb 5 '08 #2
Hi,

there's no way to move data directly from DB A to DB B in DB2. You'll have to export the data from A and load or import it into B. Maybe you'd like to use a pipe/fifo if your DB2 is at home on Linux/Unix. That way you won't have to write and read an IXF file to disk.

Regards,

Bernd

----

Expand|Select|Wrap|Line Numbers
  1. mkfifo /path/to/myfifo
  2.  
  3. db2 connect to A
  4. db2 export to /path/to/myfifo of IXF select * from ...
  5.  
  6. and meanwhile on another shell:
  7.  
  8. db2 connect to B
  9. db2 load (or import) from /path/to/myfifo of IXF insert into ...
  10.  

Hi

Thanks for the reply. I will definitely try your advice. I got around the problem by using MS Access and just creating a ODBC links to both databases and then executing an append query. Thanks for expanding my knowledge of DB2.
Feb 5 '08 #3
docdiesel
297 Expert 100+
I got around the problem by using MS Access and just creating a ODBC links to both databases and then executing an append query.
Nice idea - why didn't that come to my mind? Causes a bit of network traffic if DB A, DB B and Access DB aren't all on the same (Windows) machine, but nevertheless quiet smart.

Thanks for expanding my knowledge of DB2.
Oh, the pleasure was all mine.

Regards,

Bernd
Feb 7 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: iqbal | last post by:
Hi all, We have an application through which we are bulk inserting rows into a view. The definition of the view is such that it selects columns from a table on a remote server. I have added the...
4
by: brent.ryan | last post by:
How do I get the next int value for a column before I do an insert in MY SQL Server 2000? I'm currently using Oracle sequence and doing something like: select seq.nextval from dual; Then I...
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
4
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
6
by: rn5a | last post by:
During registration, users are supposed to enter the following details: First Name, Last Name, EMail, UserName, Password, Confirm Password, Address, City, State, Country, Zip & Phone Number. I am...
6
by: lenygold via DBMonster.com | last post by:
Hi everybody: What is the best way to I have 10 tables with similar INSERT requiremnts. INSERT INTO ACSB.VAATAFAE WITH AA(AA_TIN, AA_FILE_SOURCE_CD, .AA_TIN_TYP) AS ( SELECT AA_TIN,...
1
by: EJO | last post by:
with sql 2000 enterprise Trying to build a stored procedure that will take the rows of a parent table, insert them into another table as well as the rows from a child table to insert into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.