mysql - Update table without using REPLACE INTO -
My application stores some logs in a table locally, but it also stores the same data on the remote server database Does. If for some reason the connection to the remote server is broken, the application continues locally to the data storage. At the end of the work, the application has to copy the local data to the remote server.
The tables on either side have the same structure but no primary key is defined so replace it in Another way to copy data from the local database to the remote database Is not there a copy of existing records in the remote database?
How this table looks:
+ ------------- + ------------ + ------------ + | ProductionID | Get started | Factor | + ------------- + ------------ + ------------ + | 1123 | 1 | Y + ------------- + ------------ + ------------ + | 1123 | 2 | En | + ------------- + ------------ + ------------ + | 1123 | 3 | Y + ------------- + ------------ + ------------ + | 2212 | 6 | Y + ------------- + ------------ + ------------ + | 2212 | 4 | Y + ------------- + ------------ + ------------ + < / Div>
Actually there should be a primary key for your table. If you want to prevent duplicates from seeing all the fields, you can insert all the columns in the primary key
Optional tab your_tbl AddD CONSTRAINT pk primary key (Product ID, Start, Factor)
Comments
Post a Comment