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

QSqlQuery causes an implicit conversion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 5.10.0
    • SQL Support
    • None

    Description

      I inherited some NetBeans C++ code and QSqlQuery causes an implicit conversion in queries when passing a string.

                      q.addBindValue(labelObject->text());

      (@P1 int,@P2 int,@P3 nvarchar(14),*@P4 int,@P5 int,@P6 nvarchar(14*),@P7 int,@P8 int)

      IF EXISTS (SELECT NULL FROM VAL_LABEL WHERE ROUT_ID=@P1 AND LABEL_ID=@P2)

        UPDATE VAL_LABEL

          SET LABEL_VAL=@P3

          WHERE ROUT_ID=@P4 AND LABEL_ID=@P5

        ELSE

          INSERT INTO VAL_LABEL (LABEL_VAL,ROUT_ID,LABEL_ID)

             VALUES (@P6,@P7,@P8)

      labelObject is a QLabelEdit and the text() property is a QString.  When the objects gets bound in SQL Server it becomes a NVARCHAR and in a text field that is VARCHAR then this causes an implicit conversion which slows down my server.

      Realize that I didn't write this code but in trying to tune this code up I am finding all sorts of issues but performance issues shouldn't be caused by QT.

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mabrand Mark Brand
              waynehamberg Wayne Hamberg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes