April 4th, 2002, 05:36 AM
update in MySQL
I need to update an entire table in one database with the values from another database... My query reads like this:
update palmeira.t_colaboradores t, hr.member_status s, hr.member_data d
set t.structure=s.structure, t.depart_area=s.area where t.cs_id=d.cs_id and d.cs_id=125
in the query, plameira and hr are the 2 diff databases....
any suggestions as to how to make this work???
P.S: am using MySQL server 3.23
April 10th, 2002, 07:54 AM
I wouldn't do this in java unless they were small tables, and if so then why not do it by hand. I'd have thought it'd be slow, and if you wanted to do it on a regular basis, more relevantly it'd be a waste of coding time
There are loads of tools about one of them is sure to do database table migration (more than likely a db backup tool).
It could be done though by getting 2 db connections, and getting a result set from one and writing from cycling through it to the other
April 10th, 2002, 07:57 AM
solved it sometime bak... was too slow using java... used a php script to do it...