Fix sqlite3_lib:read_sql/4

Invalid construction of fields list in select stmt
This commit is contained in:
sergey-miryanov
2010-02-18 11:55:42 +05:00
parent e9513fade8
commit 7876c0f568

View File

@@ -213,7 +213,7 @@ read_sql(Tbl, Key, Value) ->
-spec (read_sql/4::(atom (), atom (), sql_value (), [atom ()]) -> string ()). -spec (read_sql/4::(atom (), atom (), sql_value (), [atom ()]) -> string ()).
read_sql (Tbl, Key, Value, Columns) -> read_sql (Tbl, Key, Value, Columns) ->
lists:flatten ( lists:flatten (
io_lib:format ("SELECT ~p FROM ~p WHERE ~p = ~p;", io_lib:format ("SELECT ~s FROM ~p WHERE ~p = ~p;",
[sqlite3_lib:read_cols_sql (Columns), [sqlite3_lib:read_cols_sql (Columns),
Tbl, Tbl,
Key, Key,