【发布时间】:2018-06-26 13:09:21
【问题描述】:
我正在为 Erlang 使用 mysql-otp 驱动程序。它似乎工作正常,但没有关于使用它向表中插入多行的文档。
单行插入的简单用例:
ok = mysql:query(Pid, "INSERT INTO mytable (id, bar) VALUES (?, ?)", [1, 42]).
但是我需要插入多个值,我可以这样做吗?
ok = mysql:query(Pid, "INSERT INTO mytable (id, bar) VALUES (?, ?)", [(1, 42),(2, 36), (3,12)]).
文档说明 Params = [term()],所以可能不是,这很糟糕。
【问题讨论】:
标签: mysql erlang erlang-otp