当我调用在korma中插入多行时,我得到了异常

时间:2012-08-01 08:53:44

标签: sqlite clojure korma

当我调用在korma中插入多行时,我得到异常......

Failure to execute query with SQL:
 ...snip...
SQLException:
 Message: near ",": syntax error
 SQLState: null
 Error Code: 0

发生了什么事?

额外的细节:我使用sqlite作为我的数据库。

2 个答案:

答案 0 :(得分:2)

Korma并不试图涵盖每个数据库中的每个小问题。在这种情况下,sqlite3不支持korma生成的语法。

请问问题的根源是Is it possible to insert multiple rows at a time in an SQLite database?

请参阅Korma讨论小组关于Korma在该问题上的立场的讨论:https://groups.google.com/forum/?fromgroups#!msg/sqlkorma/t7lwpD5np9w/Vf-T52fQrSwJ

答案 1 :(得分:1)

值得注意的是,自SQLite发布3.7.11以来,INSERT语句可以在VALUES子句中包含多行。 Brian Campbell首先在this answer中指出了这一点,它链接到SQLite release log for 3.7.11。所以到现在为止,无论你使用什么操作系统,SQLite版本都可能大于3.7.11,这意味着如果你现在尝试这样做,你可能会成功。