Bugfix for CharDatabase.hs

1.Missing 'tabled' field in `toRow` function. Thanks my girlfriend.
  This is the first bug she found by tracing source code :)
2.Fixed some syntax error in the SQL string.