Results 1 to 4 of 4

Thread: QSqlQuery::bindValue does not work

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSqlQuery::bindValue does not work

    Hi.

    Here is the code:

    Qt Code:
    1. QSqlQuery insQuery(*webDb);
    2. insQuery.prepare("INSERT INTO crawl_virtuemart_categories (virtuemart_category_id, virtuemart_vendor_id, category_layout, category_product_layout, products_per_row, limit_list_start, limit_list_step, limit_list_max, limit_list_initial, ordering, finished) VALUES ( :id , 1, \"default\", \"default\", 3, 0, 10, 0, 10, 1, 1)");
    3. insQuery.bindValue(":id",100);
    To copy to clipboard, switch view to plain text mode 

    Unfortunately, after execution I have syntax error, because of remaining :id instead of 100. But why? Shouldn't I mix "hardcoded" values with "dynamic" ones?

    Thanks in advance.
    Last edited by l0ud; 22nd September 2012 at 23:54.

Similar Threads

  1. QSqlQuery bindValue and SELECT WHERE IN
    By helloworld in forum Qt Programming
    Replies: 5
    Last Post: 6th November 2010, 15:45
  2. QSqlQuery::bindValue
    By viglu in forum Newbie
    Replies: 3
    Last Post: 29th March 2010, 20:13
  3. QSqlQuery::bindValue() Question
    By kandalf in forum Qt Programming
    Replies: 7
    Last Post: 30th January 2010, 12:14
  4. QSqlQuery, bindValue and Sqlite
    By cydside in forum Qt Programming
    Replies: 4
    Last Post: 5th April 2009, 16:53
  5. QSqlQuery::bindValue problem
    By segfault in forum Qt Programming
    Replies: 6
    Last Post: 11th March 2009, 07:27

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.