Hi! I created some tables using sqlite with Qt. My problem is that I noticed that using bindValue this way:
Qt Code:
  1. query.prepare("INSERT INTO monitored_files "
  2. "VALUES (NULL, :fileName, :original_relative_dir_path, :backupped_relative_dir_path, :directory_id)");
  3. query.bindValue(":fileName", entries.at(i));
  4. query.bindValue(":original_relative_dir_path", processRelativeDirPath);
  5. query.bindValue(":backupped_relative_dir_path", processRelativeDirPath);
  6. query.bindValue(":directory_id", directoryId);
  7. query.exec();
To copy to clipboard, switch view to plain text mode 
where entries.at(i) is P9040479.JPG and processRelativeDirPath is "." (without "s), I get this when listing the records in sqlite:
Qt Code:
  1. 1|'P9040479.JPG'|'.'|'.'|1
To copy to clipboard, switch view to plain text mode 
this seems to be wrong as, if I write the query directly in sqlite:
Qt Code:
  1. insert into monitored_files values (null, 'P9040479.JPG', '.', '.', 1);
To copy to clipboard, switch view to plain text mode 
I get:
Qt Code:
  1. 2|P9040479.JPG|.|.|1
To copy to clipboard, switch view to plain text mode 
The schema of my table is:
Qt Code:
  1. CREATE TABLE monitored_files (file_id INTEGER PRIMARY KEY,file_name VARCHAR(32767),original_relative_dir_path VARCHAR(32767),backupped_relative_dir_path VARCHAR(32767),directory_id INTEGER);
To copy to clipboard, switch view to plain text mode 
So it seems those Qt instructions are placing single quotes that shouldn't be there... My variables don't have those single quotes. Any idea where they come from?
Thanks!