[Qt-interest] QSqlQuery and placeholders of the same name

Антон Сердюков uksus70 at gmail.com
Fri Mar 13 08:26:23 CET 2009


I have found solution for MSSQL (in my case). Here it is.

-------------------------------------
QSqlQuery query;
query.prepare(
  "declare @param int;"
  "set @param = :param;"
  "select * from some_table where columnA > @param AND columnB = @param;"
  );

query.bindValue(":param", someValue);
query.exec();
-------------------------------------

Hope, that will help somebody.



More information about the Qt-interest-old mailing list