Sim*_*Sim 1 common-lisp cl-dbi
我有下表允许 NULL 值
CREATE TABLE test (
test int,
test2 int);
Run Code Online (Sandbox Code Playgroud)
常规查询允许插入 NULL 值:
INSERT INTO TABLE test (test, test2) VALUES (NULL, NULL)
Run Code Online (Sandbox Code Playgroud)
但是,使用 cl-dbi 不起作用
(cl-dbi:execute
(cl-dbi:prepare connection
"INSERT INTO test (test, test2)
VALUES (?,?)")
nil
nil)
Run Code Online (Sandbox Code Playgroud)
结果是
DB Error: invalid input syntax for type timestamp: "false" (Code: 22007)
Run Code Online (Sandbox Code Playgroud)
您必须使用此处:null
指示的值。
(cl-dbi:execute
(cl-dbi:prepare connection
"INSERT INTO test (test, test2)
VALUES (?,?)")
:null
:null)
Run Code Online (Sandbox Code Playgroud)