1

尝试使用 clojure.java.sql/create-table 创建表时出现异常:

batch entry 0: near "-": syntax error
  [Thrown class java.sql.BatchUpdateException]

create-table 调用如下所示:

   (sql/create-table :stories
        [:story-id :integer "PRIMARY KEY"]
        [:story-name :text]
        [:story-name-url :text]
        [:category :text]
        [:genre-one :text]
        [:genre-two :text]
        [:created-on :text]
        [:updated-on :text]
        [:review-count :integer]
        [:chapter-count :integer]
        [:word-count :integer]
        [:rating :integer]
        [:language :integer]
        [:is-complete :boolean]
        [:is-crossover :boolean]
        [:type :text]
        [:pairing :text])))) 
4

1 回答 1

2

问题是字段中不能包含“-”字符。将“-”更改为“_”将解决问题。

于 2012-08-01T05:54:15.293 回答