Results 1 to 6 of 6

Thread: SQL JOIN queries & QSqlRecord objects not storing table names

Hybrid View

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

    Default Re: SQL JOIN queries & QSqlRecord objects not storing table names

    You can use QSqlQuery::value(int index) to get the value of field index in the current record.

    Qt Code:
    1. query.exec("SELECT ....");
    2. query.next();
    3. qDebug() << query.value(0).toInt() << query.value(1).toString(); // just an example
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jul 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: SQL JOIN queries & QSqlRecord objects not storing table names

    Quote Originally Posted by saa7_go View Post
    You can use QSqlQuery::value(int index) to get the value of field index in the current record.

    Qt Code:
    1. query.exec("SELECT ....");
    2. query.next();
    3. qDebug() << query.value(0).toInt() << query.value(1).toString(); // just an example
    To copy to clipboard, switch view to plain text mode 
    The problem is that I need to use real field names, not indexes.

Similar Threads

  1. Replies: 3
    Last Post: 9th January 2010, 15:47
  2. Replies: 9
    Last Post: 19th November 2009, 09:18
  3. Replies: 7
    Last Post: 18th July 2006, 21:33
  4. Table cell merge/join
    By larry104 in forum Qt Programming
    Replies: 6
    Last Post: 16th June 2006, 22:35
  5. QDataTable + join
    By zlatko in forum Qt Programming
    Replies: 1
    Last Post: 27th April 2006, 12:56

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.