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
Forum Updated to NodeBB v4.3 + New Features

Trouble with Sql codes

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 212 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 25 Jul 2020, 20:37 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)?

    O J 2 Replies Last reply 25 Jul 2020, 21:07
    0
    • A Arash Mitooie
      25 Jul 2020, 20:37

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

      O Offline
      O Offline
      ODБOï
      wrote on 25 Jul 2020, 21:07 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
        25 Jul 2020, 20:37

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

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 27 Jul 2020, 05:57 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

        1/3

        25 Jul 2020, 20:37

        • Login

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