Results 1 to 2 of 2

Thread: Efficient way of inserting rows?

  1. #1
    Join Date
    Jul 2008
    Posts
    48
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Efficient way of inserting rows?

    Hi everyone,

    I need to insert data retrieved from a dataset into a mysql database. The way I have it right now loops through the data... builds an insert query, and then executes the query. Is there a more efficient way to do this, like a bulk insert.

    Thanks in advance,

    Ed.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Efficient way of inserting rows?

    It depends on the database backend itself. See QSqlQuery::execBatch(), maybe it'll be useful for you.

Similar Threads

  1. QSqlTableModel inserts empty rows
    By Nesbitt in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 12:47
  2. Treeview scrollbar not updating when inserting rows
    By Khal Drogo in forum Qt Programming
    Replies: 11
    Last Post: 29th November 2007, 13:13
  3. Removing rows
    By indifference in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2007, 16:54
  4. Replies: 1
    Last Post: 28th September 2006, 06:21

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.