Results 1 to 8 of 8

Thread: QSqlQuery

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Dec 2009
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default Re: QSqlQuery

    This is from SQL programming doc on http://qt-project.org/doc/qt-4.7/sql...3-cf2704e240a2

    Qt Code:
    1. QSqlQuery query;
    2. query.exec("INSERT INTO employee (id, name, salary) "
    3. "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;

    Qt Code:
    1. QSqlQuery query;
    2. query.exec("INSERT INTO employee (\"id\", \"name\", \"salary\") "
    3. "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.
    Last edited by rajko; 21st May 2012 at 16:05.

Similar Threads

  1. Replies: 1
    Last Post: 18th July 2011, 12:12
  2. Using QSqlQuery
    By darkman_dev in forum Newbie
    Replies: 2
    Last Post: 4th February 2011, 21:40
  3. QSqlQuery
    By yasher in forum Qt Programming
    Replies: 2
    Last Post: 23rd July 2010, 14:25
  4. QSqlquery
    By codeman in forum Qt Programming
    Replies: 10
    Last Post: 4th June 2009, 12:57
  5. what is going on a QSqlQuery?
    By mismael85 in forum Qt Programming
    Replies: 2
    Last Post: 26th June 2008, 13:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.