Quantcast
Channel: User andrewsi - Stack Overflow
Viewing all articles
Browse latest Browse all 51

Answer by andrewsi for MySql Bulk(ish) Insert

$
0
0

When you use

INSERT INTO `order_status_histories` VALUES (....)

you need to pass each value that the table structure requires, in the correct order. You can omit fields from the values if they have a default value in the table structure.

Most of the time, it's better to explicitly list the fields that you want to insert to - if nothing else, it means that if the table structure changes, you won't need to re-write your SQL statements. Try changing your SQL statement so it's structured as:

INSERT INTO `order_status_histories` (field1, field2, ....) VALUES ('value1', 'value2', ....)

Viewing all articles
Browse latest Browse all 51

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>