Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    QSql - save query / buffer when it fails - issue with placeholders

    General and Desktop
    1
    1
    251
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JulienMaille last edited by JulienMaille

      Dear all,
      I'm using QSql module to store measurement data in a distant database.
      I would like to handle network disconnection and buffer the queries when they fail.
      One of my ideas was to store the query in a text file and process it later when connection is restored.

      However I'm using a prepared statement and binding the values, so I need a way to get the whole query (prepared with the placeholders replaced by their bound values).

      QSqlQuery::lastQuery() and QSqlQuery::executedQuery() both give me the original prepared statement, with the placeholders. Is a way to get the sql command?

      If you have a better suggestion to buffer failed queries, let me know!
      Thank you

      1 Reply Last reply Reply Quote 0
      • First post
        Last post