build update clauses correctly

This commit is contained in:
Sean Dague
2007-08-09 20:07:58 +00:00
parent 9fb651932e
commit ec0dc208dd

View File

@@ -184,9 +184,14 @@ namespace OpenSim.DataStore.MonoSqliteStorage
private SqliteCommand createUpdateCommand(string table, string pk, Dictionary<string, DbType> defs)
{
string sql = "update " + table + " set ";
string subsql = "";
foreach (string key in defs.Keys) {
sql += key + "= :" + key + ", ";
if (subsql.Length > 0) { //
subsql += ", ";
}
subsql += key + "= :" + key;
}
sql += subsql;
sql += " where " + pk;
SqliteCommand cmd = new SqliteCommand(sql);