Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.10.0
-
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
- relates to
-
QTBUG-91778 String length calculation in SQLBindParameter appears incorrect
- Reported