Results 1 to 6 of 6

Thread: Sqlite multipule row insert question

Threaded View

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

    Default Re: Sqlite multipule row insert question

    Line 39 should be
    Qt Code:
    1. db.next()
    To copy to clipboard, switch view to plain text mode 
    like your original code shouldn't it?

    The message regarding violation of a constraint can only be coming from the insert. Duplicate primary key value would be the first place to look although there can be other constraints defined on the reporttemplates table. It's not clear which (if any) column is a unique identifier for a row. If you are not inserting a value into any primary key column, and it is not an auto-increment type field, then the second row insert will have the same id as the first (e.g. NULL, 0 or empty) and fail.

  2. The following user says thank you to ChrisW67 for this useful post:

    rogerholmes (31st December 2009)

Similar Threads

  1. Insert unicode in SQlite
    By Kastagne in forum Qt Programming
    Replies: 3
    Last Post: 11th October 2011, 14:07
  2. SQLite sometimes doens't INSERT into database
    By cevou in forum Qt Programming
    Replies: 5
    Last Post: 30th October 2009, 08:10
  3. SQLite beginner question...
    By theMac in forum Newbie
    Replies: 3
    Last Post: 2nd September 2009, 00:01
  4. Replies: 0
    Last Post: 4th December 2008, 05:48
  5. Bulk insert into SQLite
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 19th November 2007, 03: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.