How to bulk insert in mySql and node.js using mysljs

后端 未结 3 1295
抹茶落季
抹茶落季 2021-02-14 15:40

Im not able to use bulk insert in my DB using node.js lib mysljs.

I followed answers from:

How do I do a bulk insert in mySQL using node.js

with no succ

相关标签:
3条回答
  • 2021-02-14 16:10

    try using () around the question mark

    var sql = "INSERT INTO resources (resource_container_id, name, title, extension, mime_type, size) VALUES (?) ";

    0 讨论(0)
  • 2021-02-14 16:11

    Try removing the square brackets around values

    0 讨论(0)
  • 2021-02-14 16:33

    You need to mark your keys with the grave accent (backtick) character, like this: `key`

    Making your query like this:

    var sql = "INSERT INTO resources (`resource_container_id`, `name`, `title`, `extension`, `mime_type`, `size`) VALUES ?";
    
    0 讨论(0)
提交回复
热议问题