Avatar of Vladimir Buzalka
Vladimir BuzalkaFlag for Czechia

asked on 

Best approach to update mySQL table from FoxPro

Hi all,

I would like to have your idea what is the best way to update mySQL table  with data from FoxPro table.

I.e. I have 600 000 records in my foxpro table, 2 columns (id, md5) and I have 600 000 records in mySQL with 2 columns (id, md5). MySQL column ID contains same IDs as foxpro table and I need the quickest appoach to assign MD5 from foxpro table to mySQL table.

Any ideas are welcome.

Vladimir
FoxPro

Avatar of undefined
Last Comment
Olaf Doschke
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

If you have any additional fields about a change date of the records and a last import/update date, then you could limit yourself to only update changes since the last update.

The easiest is to truncate the mysql table and insert all data into it from the dbf afterwards, as that will be the same result as when updating the existing records from the dbf.

Bye, Olaf.
Avatar of Vladimir Buzalka

ASKER

Hi Olaf, I understand,. the best way is to import directly in the single step all foxpro table to mySQL. However I am just curious how to UPDATE mySQL  in my scenario?
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

It is impossible to tell what is the quickest approach because you don't disclose existing indexes. You are also not disclosing your infrastructure, number of concurrently working users, and network speed which is also very important for the decision.

If no indexes exist then the really quickest way is to truncate the MySQL table and create a new one from VFP data. You should import as many rows in one command as possible.
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

...and because of that you better know in advance which records have changed in the dbf since the last time you updated the mysql table from the dbf.

Another way is to couple these systems, eg instead oif using the dbf let the vfp applicaion work on the mysql database in the first place or at least have triggers in a dbc that do the same changes towards mysql data, as is done on the dbf.

Bye, Olaf.
FoxPro
FoxPro

Visual FoxPro (VFP), and its predecessor FoxPro, is a data-centric, object-oriented, procedural, database programming language and IDE from Microsoft last released in 2007 that still has some active use due to its low cost of deployment and fairly rapid development. In 2008, Microsoft released a set of add-ons for VFP's xBase components to allow interoperability with various Microsoft technologies. It allows data processing against its native file-based data tables or database servers such as SQL Server.

11K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo