Trouble with Sql codes
-
wrote on 25 Jul 2020, 20:37 last edited by
Hi everyone
This is my first post here. I hope you can bare with me as Im so novice in all coding stuff. . .
My problem now is:
I can get sql results back to Qt tables (via TableView and QSqlQueryModel). But as soon as my query contains some executable code (like using if/else or variables or functions/procedures), it won't work. My Sql code executes well and gives expected result in SQL Server management studio. What am I doing wrong (I'm using Qt C++ and SQL Server)? -
Hi everyone
This is my first post here. I hope you can bare with me as Im so novice in all coding stuff. . .
My problem now is:
I can get sql results back to Qt tables (via TableView and QSqlQueryModel). But as soon as my query contains some executable code (like using if/else or variables or functions/procedures), it won't work. My Sql code executes well and gives expected result in SQL Server management studio. What am I doing wrong (I'm using Qt C++ and SQL Server)?wrote on 25 Jul 2020, 21:07 last edited byhi and welcome
@Arash-Mitooie said in Trouble with Sql codes:it won't work
What does that mean exactly ? What error do you get ?
Can you show an example of query that will fail ?
These information will help others to help you, i have not much experience with sql -
Hi everyone
This is my first post here. I hope you can bare with me as Im so novice in all coding stuff. . .
My problem now is:
I can get sql results back to Qt tables (via TableView and QSqlQueryModel). But as soon as my query contains some executable code (like using if/else or variables or functions/procedures), it won't work. My Sql code executes well and gives expected result in SQL Server management studio. What am I doing wrong (I'm using Qt C++ and SQL Server)?@Arash-Mitooie What does https://doc.qt.io/qt-5/qsqlquerymodel.html#lastError tell you?
1/3