Results 1 to 5 of 5

Thread: How to get sqlite error message RAISE by trigger

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Posts
    70
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to get sqlite error message RAISE by trigger

    Hi,

    I have a sqlite database containing trigger to manage constraints.
    (see attached file)

    If I try to violate a constraint with sqlite3, the right error message is returned:
    Qt Code:
    1. sqlite> delete from unit;
    2. SQL error: delete on table unit violates foreign key constraint fkd_unit_unit_rc_unit_id_id
    To copy to clipboard, switch view to plain text mode 


    But, if I try to violate a constraint with QT API (QSqlQuery), this error message is returned by QSqlError::lastError():
    Qt Code:
    1. constraint failed Impossible d'extraire la ligne
    To copy to clipboard, switch view to plain text mode 


    Do you know how to do to retrieve the right error message with QT API ?

    In advance, thank you.
    Attached Files Attached Files

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.