Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-130855

Problem with temporary sql table.

    XMLWordPrintable

Details

    • Windows

    Description

      When using QSqlQuery::prepare to create a temporary SQL table with the command "CREATE TABLE <#tmpTable>(id int NOT NULL)", followed by executing it with QSqlQuery::exec() on Microsoft SQL Server, no error is returned. However, when inserting data into the temporary SQL table afterward using "INSERT INTO <#tmpTable>(id) VALUES", an error occurs, stating that the temporary SQL table does not exist.

      On the other hand, if the temporary SQL table is created using QSqlQuery::exec("CREATE TABLE <#tmpTable>(id int NOT NULL)") without QSqlQuery::prepare, subsequent data insertion into the temporary SQL table works as expected.

       

      To reproduce the issue, set the command to connect to the database, and then run the attached example project.

      Attachments

        1. issuesql.zip
          3 kB
          Mehdi Belila
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            chehrlic Christian Ehrlicher
            mahdi.belila Mehdi Belila
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes