I have a SQL query( call to a stored procedure to MSSQL) that takes arbitrary length of BINARY type as argument.I am using QT's support for stored procedure. But according to this, there is no corresponding QT type for varbinary for ODBC. QT requires a type that can be converted to QVariant when passing parameters to sql queries.
For binary types of length in bytes <= 8, i used quint64, and it does not complain.
But,for arbitrary length varbinary, if i use QString, i get this error:
QODBCResult::exec: Unable to execute statement: "[Microsoft][ODBC SQL Server Driver][SQL Server]Implicit conversion from data type nvarchar to binary is not allowed. Use the CONVERT function to run this query.
If i use a QByteArray, i get this error:
QODBCResult::exec: Unable to execute statement: "[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid parameter 79 (''): Data type 0x22 is a deprecated large object, or LOB, but is marked as output parameter. Deprecated types are not supported as output parameters. Use current large object types instead."
Would be nice if anybody has any suggestions.
@a binary(2) = NULL,
@b binary(5) = NULL,
@c binary(3) = NULL,
@d binary(3) = NULL,
@e binary(8) = NULL,
@f binary(32) = NULL,
QSqlQuery query(QSqlDatabase::database(dbname));
setQueryStatement(queryString);
prepareQuery(query);
query.bindValue(":f",/* what datatype variable should i put here */);
query.exec();