Results 1 to 3 of 3

Thread: QSqlQuery don't return

  1. #1
    Join Date
    Aug 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSqlQuery don't return

    Hello, I'm having a strage problem, I'm using Qt 4.6.3 and sqlite 3.7.2 and a certain query return results from sqlite command line but don't return anything from QSqlQuery

    The query
    Qt Code:
    1. SELECT DISTINCT(incomings.id) FROM incomings JOIN incoming_products ON incoming_products.incoming_id = incomings.id WHERE incoming_products.name LIKE '%ar%'
    To copy to clipboard, switch view to plain text mode 

    a part of code
    Qt Code:
    1. QSqlQuery query;
    2. qDebug() << query.exec("SELECT DISTINCT(incomings.id) FROM incomings JOIN incoming_products ON incoming_products.incoming_id = incomings.id WHERE incoming_products.name LIKE '%ar%'");
    3. qDebug() << query.size();
    To copy to clipboard, switch view to plain text mode 

    the output
    Qt Code:
    1. true
    2. -1
    To copy to clipboard, switch view to plain text mode 

    this is the only query of my app that don't work and the only thing I need to finish my app
    anybody know why this don't work?

  2. #2
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QSqlQuery don't return

    Look at this thread

  3. #3
    Join Date
    Aug 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlQuery don't return

    wow, thx, this lead me to real error, on setFilter of a QSqlRelationalTableModel I need to use table.field, only field don't work hehe

Similar Threads

  1. Replies: 11
    Last Post: 11th April 2014, 14:11
  2. QSqlQuery
    By yasher in forum Qt Programming
    Replies: 2
    Last Post: 23rd July 2010, 14:25
  3. QSqlQuery return result
    By arpspatel in forum Qt Programming
    Replies: 2
    Last Post: 9th April 2010, 07:55
  4. Replies: 1
    Last Post: 17th January 2010, 07:36
  5. QSqlQuery always return junk value while for varchar oracle.
    By ranjit2709 in forum Qt Programming
    Replies: 3
    Last Post: 7th August 2007, 05:19

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.