Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.12.2
-
None
Description
I have a problem with QODBC driver. I am connecting to a MSQLserver 2017. I have the following Native Client: ODBC Driver 17 for SQL Server
--------------------------------------------------
QString str1 = "SELECT * FROM Table1 WHERE FullName = :FullName";
QString str2 = "\\\\abcidnas\\data\\Formats\\avexxxrokee_xxxxbset\\Cvvvvv_JJJJJJJJJJ\\RS2_OK7002_PK95155_DK94211_SCNB_20090909_234152_HHHHHHHHH
LLLLLLLLLLL.tif";
if (Query.prepare(str1))
Query.bindValue(":FullName", str2);
Query.exec();
------------------------------------------------------------------------
we have observed that if the value for the bindvalue for the prepare statement is too long, then the prepare statement fails with
QODBCResult::exec: Unable to execute statement: "[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The data types nvarchar(max) and ntext are incompatible in the equal to operator. [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Statement(s) could not be prepared."
We don t use at all NTEXT in the design of our database.
what works:
if I use a Direct Exec and not a prepare statement it works.
Query.exec("SELECT * FROM Table1 WHERE FullName = '\\\\abcidnas\\data\\Formats\\avexxxrokee_xxxxbset\\Cvvvvv_JJJJJJJJJJ\\RS2_OK7002_PK95155_DK94211_SCNB_20090909_234152_HHHHHHHHH
LLLLLLLLLLL.tif'"))
If the binding value is small then it works.
Other things tested
I tried several datatype for the column FullName : NVARCHAR(MAX), VARCHAR(MAX),... nothing worked.
Maybe I am missing a configuration ....
Thank you, any help appreciated. This is customer issue.
Attachments
Issue Links
- relates to
-
QTBUG-91778 String length calculation in SQLBindParameter appears incorrect
- Reported