I was not able to use massive insertion in my DB using node.js lib mysljs .
I followed the answers:
How to perform bulk insert in mySQL using node.js
without success.
var sql = "INSERT INTO resources (resource_container_id, name, title, extension, mime_type, size) VALUES ?"; var values = [ [1, 'pic1', 'title1', '.png', 'image/png', 500], [1, 'pic2', 'title2', '.png', 'image/png', 700]]; return connection.query(sql, [values], (result) => { if (err) throw err; connection.end(); });
I keep getting the error:
'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'?\' at line 1'
I also tried promising a mehod request using bluebird, but without success, I get the same error again.
Ivan PandΕΎiΔ Dec 15 '16 at 18:20 2016-12-15 18:20
source share