Results 1 to 3 of 3

Thread: QSqlRelationalTableModel get error: constraint failed unable to fetch row

  1. #1
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default QSqlRelationalTableModel get error: constraint failed unable to fetch row

    I'm using QSqlRelationalTableModel and QtableView to insert data to SQLite Database, I get an error message: constraint failed unable to fetch row; when I insert data into table has Relation. I don’t know how to fix this problem.

    Help me!

  2. #2
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: QSqlRelationalTableModel get error: constraint failed unable to fetch row

    Very hard to tell without seeing your database schema and what you are doing. Clearly you try to do something, which is forbidden in your schema, e.g. insert a 0 in a column, which has the constraint 'NOT NULL', or adding duplicate values in a column with the constraint 'UNIQUE'. Unfortunately SQLite is not able to tell exactly which constraint you are violating and why.

  3. #3
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QSqlRelationalTableModel get error: constraint failed unable to fetch row

    I understand SQL works. I’m sure that no cases like you said above.

Similar Threads

  1. Replies: 3
    Last Post: 16th December 2010, 19:54
  2. QMYSQL3: Unable to fetch data
    By crystlrain in forum Qt Programming
    Replies: 2
    Last Post: 11th November 2009, 07:24
  3. QSqlRelationalTableModel settable unable to find
    By nietzsche in forum Qt Programming
    Replies: 0
    Last Post: 25th May 2009, 22:51
  4. Unable to fetch data when searching through select query
    By sinha.ashish in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2008, 14:06
  5. QSQLITE Unable to fetch row in create
    By xgoan in forum Newbie
    Replies: 3
    Last Post: 18th October 2006, 14:39

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.