This is from SQL programming doc on http://qt-project.org/doc/qt-4.7/sql...3-cf2704e240a2
query.exec("INSERT INTO employee (id, name, salary) "
"VALUES (1001, 'Thad Beaumont', 65000)");
QSqlQuery query;
query.exec("INSERT INTO employee (id, name, salary) "
"VALUES (1001, 'Thad Beaumont', 65000)");
To copy to clipboard, switch view to plain text mode
This doesn't work for me , it say QSql error, error near parentheses. If I want that this above works I have to do this;
query.exec("INSERT INTO employee (\"id\", \"name\", \"salary\") "
"VALUES (1001, 'Thad Beaumont', 65000)");
QSqlQuery query;
query.exec("INSERT INTO employee (\"id\", \"name\", \"salary\") "
"VALUES (1001, 'Thad Beaumont', 65000)");
To copy to clipboard, switch view to plain text mode
The same is if I use placeholders.
And it doesn't work with single quotes either. When I look in any object in Postgres every action described in SQL is double quoted, schema.table is double quoted like this "testSchema"."testTable", but in Postgres manual on page http://www.postgresql.org/docs/9.1/s...ql-insert.html is the same as in qt docs above but as I said it doesn't work, I tried several times.
Bookmarks