PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Best way to update local data to a remote server
Best way to update local data to a remote server
Débuté par Yogi Yang, 15 sep. 2014 16:21 - 4 réponses
Posté le 15 septembre 2014 - 16:21
I a software that we are developing there is a need where in the software will update all the information from its local HFSQL Classic files to a remote MySQL server.

Currently what I am doing is:
Delete all Rows from the Table on remote MySQL server
Reading values of each row from local HFSQL Classic and build an Insert Query
Execute the Insert Query on remote MySQL server

This was working fine with small number of rows. But as the number of rows increased the process is taking up a very long time.

Is there any better and more quicker way to update remote MySQL server?

TIA

Yogi Yang
Posté le 15 septembre 2014 - 16:57
If you export your local HF file to XML and import it to the mysql db it's probably faster.

You can do it with 3 steps:
1. export your HF file to XML (HExportXML)
http://doc.windev.com/en-US/…
2. delete the row in mysql table or if it's for all the lines just truncate the table
3. import the xml file into the mysql table (LOAD XML) <a class="ExternalLink" rel="nofollow" target="_blank" href="http://dev.mysql.com/doc/refman/5.5/en/load-xml.html">http://dev.mysql.com/doc/refman/5.5/en/load-xml.html</a>

The other sugestion is using some replication mechanism to export/import only the inserted/modified/deleted records since the last execution.
Posté le 16 septembre 2014 - 16:23
Paulo,

Thanks for your suggestions.

I will definately check this possibilities.

Quote
Paulo

The other sugestion is using some replication mechanism to export/import only the inserted/modified/deleted records since the last execution.
Can you give me more info on this replication possibilities or point me in the right direction. I mean can we use it across different RDMSs?

TIA

Yogi Yang
Posté le 16 septembre 2014 - 20:12
You can find a lot of information about replication in the help.
Text from the help:
The purpose of the universal replication is to keep several databases synchronized. These databases can have different types. A replication can be performed:
between a HFSQL database and an Oracle database.
between HFSQL Classic or HFSQL Client/Server databases.

<a class="ExternalLink" rel="nofollow" target="_blank" href="http://doc.windev.com/en-US/?9000032">http://doc.windev.com/en-US/&hellip;</a>

As far as i can remember Fabrice Harari is doing some open source project to manage the replication of data just search the forum for WXREPLICATION.
Posté le 18 septembre 2014 - 12:40
Thanks.

I will look into this documentation and see how I can use it to my benefit and wether it will work on remote MySQL server or not.

TIA

Yogi Yang