jazzIIIlove
asked on
merging 2 mysql databases with java
Hi,
I need to merge 2 mysql databases with java or python.
The databases are exactly the same in schema but data is different.
in terms of the query which i need to pass in java or python. Anything i should care about?
Would it be the case that i need to insert data to the table having foreign key first?
what is the strategy?
Br.
I need to merge 2 mysql databases with java or python.
The databases are exactly the same in schema but data is different.
in terms of the query which i need to pass in java or python. Anything i should care about?
Would it be the case that i need to insert data to the table having foreign key first?
what is the strategy?
Br.
I don't think there's a 'simple' way to do it. It's just a question of putting the work in
ASKER
Hi,
But any approach you suggest?
Br.
But any approach you suggest?
Br.
You need to issue a series of queries for each and every table
ASKER
Should i do this e.g
A) Table 2 fk (source): insert into Table 2' fk (target)
B) Table 1 pk (source): insert into Table 1' pk (target)
Should i do in this order (A, B)
Fk: foreign key, Pk: primary key
Prime tables are the tables that will have the merged data
A) Table 2 fk (source): insert into Table 2' fk (target)
B) Table 1 pk (source): insert into Table 1' pk (target)
Should i do in this order (A, B)
Fk: foreign key, Pk: primary key
Prime tables are the tables that will have the merged data
Foreign keys would be a consideration if you are going to get referential integrity violations, yes. In that case, you need to do them in an order that doesn't cause violations
ASKER
Do you think my above order is correct?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.