Results 1 to 3 of 3

Thread: How to delete results of QSqlQuery from table ?

  1. #1
    Join Date
    Oct 2010
    Posts
    91
    Thanks
    38

    Default How to delete results of QSqlQuery from table ?

    Hello!

    Usually I take the normal way to delete stuff from a database:

    Qt Code:
    1. DELETE FROM BooksTemp WHERE id = 1;
    To copy to clipboard, switch view to plain text mode 

    But is there another way to delete the results of a QSqlQuery from the underlying SQL table, e.g. to query for stuff, do something to the data and remove it afterwards?

    Something like

    Qt Code:
    1. QSqlQuery::deleteFromTable();
    To copy to clipboard, switch view to plain text mode 

    Kind regards,
    HomeR

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to delete results of QSqlQuery from table ?

    What's wrong with the "normal" way using the same SQL where clause?

  3. #3
    Join Date
    Oct 2010
    Posts
    91
    Thanks
    38

    Default Re: How to delete results of QSqlQuery from table ?

    What's wrong with the "normal" way using the same SQL where clause?
    Nothing at all, I just want to know if such a function exists.

Similar Threads

  1. Replies: 4
    Last Post: 19th February 2009, 11:10
  2. Extracting QSqlQuery results in PyQt4
    By amicitas in forum Qt Programming
    Replies: 2
    Last Post: 9th October 2008, 05:10
  3. QTreeView with results from an SQL query.
    By ederbs in forum Qt Programming
    Replies: 1
    Last Post: 19th October 2007, 02:41
  4. Replies: 9
    Last Post: 21st June 2007, 10: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.