CLSQLでプリペアドステートメント
clsqlのプリペアドステートメントがうまくいかない。
(clsql-sys:with-database (con '("localhost" "test_user" "test_user" "p") :if-exists :old :database-type :postgresql-socket) (let ((stmt (clsql-sys:prepare-sql "update tb0 set data1=? where id=?" '((:string 10) :int) :database con))) (clsql-sys:bind-parameter stmt 1 "ききききき") (clsql-sys:bind-parameter stmt 2 0) (setf r (clsql-sys:run-prepared-sql stmt)) (format t "result ~A~%" r)))
こんな感じで指定したら
A CLSQL lisp code error occurred: Unknown clsql type (STRING 10). [Condition of type CLSQL-SYS:SQL-USER-ERROR]
だって。
prepare-sqlのtypes指定は
A type can be :int :double :null (:string n)
って書いてあるのに。
:nullだと
A CLSQL lisp code error occurred: Unknown clsql type NULL. [Condition of type CLSQL-SYS:SQL-USER-ERROR]
だし。
どうすりゃいいのさーー。