By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,705 Members | 2,013 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,705 IT Pros & Developers. It's quick & easy.

update a database

P: n/a
Hi.

Ive a problem. I have two diffrent databases. And I want to update
database B with database A. But when a column is missing in the B it
wont be insert with the update of A. Whole tables will be created but
not columns.
What kind of order I must use?
Thanks for your advice.

Tania
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Tania wrote:
Hi.

I´ve a problem. I have two diffrent databases. And I want to update
database B with database A. But when a column is missing in the B it
won´t be insert with the update of A. Whole tables will be created but
not columns.
What kind of order I must use?
Thanks for your advice.

Tania

Take the New Jersey Turnpike to exit 16 and then head south.

You can't miss it.

Next !!

Nov 12 '05 #2

P: n/a
ta*****@freenet.de (Tania) wrote in message news:<f2**************************@posting.google. com>...
Hi.

Ive a problem. I have two diffrent databases. And I want to update
database B with database A. But when a column is missing in the B it
wont be insert with the update of A. Whole tables will be created but
not columns.
What kind of order I must use?
Thanks for your advice.

Tania


Tania,

You don't say which RDBMS you're using, so this will have to be vague.
If I were trying to move data from an Oracle database to a MySQL
database, I'd use a select statement to get the data I wanted into a
file and then use a LOAD DATA in MySQL to import that data into the
other database. If you know there are fields in the tables of the
first database that are not in the second database, then you don't
include them in the select statement. And you'll have to write the
select statement to get the fields in the order that they appear in
the second database. If both databases are in the same RDBMS, then it
should be much easier than this.

Hope this helps,

Andy C.(never #)
Nov 12 '05 #3

P: n/a
If I presume you're working with DB2 UDB for LUW V7or V8 and both db's
are in those types of sytem, and the tables bear the same name in each
db then you should look at the db2move command.
Db2move export will get all of your your data properly exported in IXF
gormat.
db2move import replace/create,(you can't use load here as the tahere are
discrepancies with no. of columns), will drop/recreate the tables with
the proper column defs. and then will move the data in.
I also presume here that you did not need to add the data but just
replace it.

Another way would be to use db2look to extract all the ddl from databse
A, edit the outpout file to ensure there will be no discrepancies with
the database B tablespace defs., edit out all tables that are identical
in definition, drop the tables that are not from database B. Use
db2move export to get your data out of A and db2move load insert or
replace to get the data in B.

HTH, Pierre.

Tania wrote:
Hi.

Ive a problem. I have two diffrent databases. And I want to update
database B with database A. But when a column is missing in the B it
wont be insert with the update of A. Whole tables will be created but
not columns.
What kind of order I must use?
Thanks for your advice.

Tania


--
Pierre Saint-Jacques - Reply to: sesconsjunk at attglobaljunk dot com
Reconstruct address: Remove the two junk and replace at and dot by
their symbols.
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.