Results 1 to 3 of 3

Thread: Recursive execs on a QSqlQuery

  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Recursive execs on a QSqlQuery

    Hi everybody

    is it possible to do recursive sql command executions on a QSqlQuery like this:

    subset A = SELECT * FROM some_table WHERE type_id = magic_number

    afterwards do another selection but on subset A like this (non valid syntax )

    SELECT * FROM subset A WHERE something


    Thanks for help!

  2. #2
    Join Date
    Mar 2009
    Posts
    25
    Thanked 2 Times in 2 Posts

    Default Re: Recursive execs on a QSqlQuery

    Why not just

    SELECT * FROM (SELECT * FROM some_table WHERE type_id = magic_number) WHERE something

    Sql query is to query the database. After the first query you get a result set, which is not a datebase. You cannot run another sql query on the result set. You have to write code to loop through it.

  3. #3
    Join Date
    Jan 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Recursive execs on a QSqlQuery

    Thank you! That's a great idea.

Similar Threads

  1. Problems with QSqlQuery update
    By whoops.slo in forum Qt Programming
    Replies: 4
    Last Post: 28th August 2006, 07:17

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.