From 46fa473b481191288e2ca6d9279e099b303af012 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 30 Mar 2015 20:44:02 +0200 Subject: o Better sql generation. --- sensor/main/io.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sensor') diff --git a/sensor/main/io.cpp b/sensor/main/io.cpp index 255b4f5..fa15c96 100644 --- a/sensor/main/io.cpp +++ b/sensor/main/io.cpp @@ -336,8 +336,8 @@ void SqlSampleOutputStream::write(SampleRecord const &sample) { fs += ", "; vs += ", "; } - fs += key->name; - vs += value.get(); + fs += "\"" + key->name + "\""; + vs += "'" + value.get() + "'"; } } } else { @@ -354,8 +354,8 @@ void SqlSampleOutputStream::write(SampleRecord const &sample) { // Make sure that the key is registered in the dictionary dict.indexOf(sample_key->name); - fs += sample_key->name; - vs += o.get(); + fs += "\"" + sample_key->name + "\""; + vs += "'" + o.get() + "'"; } } } -- cgit v1.2.3