Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Trouble with Sql codes
Qt 6.11 is out! See what's new in the release blog

Trouble with Sql codes

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 461 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arash Mitooie
    wrote on last edited by
    #1

    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)?

    ODБOïO jsulmJ 2 Replies Last reply
    0
    • A Arash Mitooie

      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)?

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      hi 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

      1 Reply Last reply
      4
      • A Arash Mitooie

        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)?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Arash-Mitooie What does https://doc.qt.io/qt-5/qsqlquerymodel.html#lastError tell you?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        3

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved