UPDATE + INSERT option in Export

[expired user #9010]'s profile image [expired user #9010] posted 9 years ago in Import/Export Permalink
Hi, I want to know if is it possible to make update and insert data into a 2nd database in EXPORT MODE?
For example, I have 2 similar databases.I want to export data in another database. If data already, exists, system must make update. If it does not exist, it must be inserted.
Help me please !
ansgar's profile image ansgar posted 9 years ago Permalink
Using the "REPLACE" mode should roughly do what you want to do.
[expired user #9421]'s profile image [expired user #9421] posted 8 years ago Permalink
A replace would delete that row and insert it again.
This could delete referencing data in other tables (foreign key 'ON DELETE CASCADE').

A better choice would be an option like 'ON DUPLICATE KEY UPDATE'!
ansgar's profile image ansgar posted 8 years ago Permalink
Ok, sounds reasonable. That will require a new option in the data dropdown - something like "Insert new and update existing"
[expired user #9510]'s profile image [expired user #9510] posted 8 years ago Permalink

We need an Export SQL Update Option too.

This is very usefull if you selected just a few columns and you want to export and update your existing production database.

On Replace all data is erased, the columns selected are refilled, but all not selected are filled with default values. (I ran into once :-P but my fault)

Thx

Please login to leave a reply, or register at first.