Important: Please read the Qt Code of Conduct -

SQqlQuery prepare {CALL SqlProcName(?,?)} No longer working in Qt 5.3

  • Hello,

    I wrote an application some time ago using Qt 4.3 and it has worked without issue till now. I needed to make a change to the code and took the opportunity to upgrade to 5.3. Having ironed out some wrinkles the project builds and runs. However when it encounters a QSqlQuery prepare using the {CALL ....(?,...)} syntax it fails with the following error.

    [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error QODBC3:Unable to execute statement.

    None of the procedures in the database has changed so I don't understand what I'm missing, the documentation (as I see) shows no examples of using this syntax or indeed any other. Is there a simple change I can make to allow me to continue to use my code or can someone please describe the new syntax I need to use to use parameter bound procedures in 5.3.

    Thank you.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You might have hit a regression. Can you test your code against the latest Qt 4.8 ? That would allow to know whether this is only something that changed in Qt 5.

    After the test, please consider opening a bug report "here": providing a minimal compilable example that shows how to reproduce the behavior.

  • Hello SGaist,

    Thanks for the quick reply. This project was built on new hardware using VS 2013 and the VS Plugin and on looking at the download page I see I would need to install VS 2010 at minimum, and I'm unable to do this.

    I'm not sure where to go with this now, so if anyone else can shed some light on this I'd be grateful.


  • Lifetime Qt Champion

    You can build Qt 4 yourself (it's really not complicated) with VS2013

  • Or you may find pre-built binaries "here":

Log in to reply