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. Got problem with prepare statement in sqlite
Forum Updated to NodeBB v4.3 + New Features

Got problem with prepare statement in sqlite

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 3 Posters 4.1k 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 15 Nov 2017, 20:43 last edited by
    #7

    You are trying to open your database twice.

    Again, like already wrote before: open your connection once at application startup and then just do your queries. You'll avoid losing time with that.

    As for performance, what else is your application doing ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    M 1 Reply Last reply 15 Nov 2017, 20:47
    0
    • S SGaist
      15 Nov 2017, 20:43

      You are trying to open your database twice.

      Again, like already wrote before: open your connection once at application startup and then just do your queries. You'll avoid losing time with that.

      As for performance, what else is your application doing ?

      M Offline
      M Offline
      mark_ua_1999
      wrote on 15 Nov 2017, 20:47 last edited by
      #8

      @SGaist I understand you but I failed to do it it doesnt see the db as opened (I opened it in constructor)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 15 Nov 2017, 20:50 last edited by
        #9

        Then fix your database initialisation in the constructor rather than trying to work around.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        M 1 Reply Last reply 15 Nov 2017, 20:53
        0
        • S SGaist
          15 Nov 2017, 20:50

          Then fix your database initialisation in the constructor rather than trying to work around.

          M Offline
          M Offline
          mark_ua_1999
          wrote on 15 Nov 2017, 20:53 last edited by
          #10

          @SGaist And what about not line by line code execution?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 15 Nov 2017, 20:56 last edited by
            #11

            What do you mean by that ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            M 1 Reply Last reply 15 Nov 2017, 20:59
            0
            • S SGaist
              15 Nov 2017, 20:56

              What do you mean by that ?

              M Offline
              M Offline
              mark_ua_1999
              wrote on 15 Nov 2017, 20:59 last edited by
              #12

              @SGaist I mean by that that the code is to slow from user vision (firstly it inserts new records to db table and only than add the row (Add function although) it goes first and returns bool result)the code

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 15 Nov 2017, 21:03 last edited by
                #13

                There's no way to evaluate why your application is slow based only on one function.

                Do some profiling on your application to understand what takes so much time.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                M 1 Reply Last reply 15 Nov 2017, 21:08
                0
                • S SGaist
                  15 Nov 2017, 21:03

                  There's no way to evaluate why your application is slow based only on one function.

                  Do some profiling on your application to understand what takes so much time.

                  M Offline
                  M Offline
                  mark_ua_1999
                  wrote on 15 Nov 2017, 21:08 last edited by
                  #14

                  @SGaist ADD function must execute first!!! But not

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 15 Nov 2017, 21:19 last edited by
                    #15

                    Full uppercased words and many exclamation marks are not the best way to communicate when people are trying to help you on their own time.

                    You are only providing a small part of your code and stating that your users find it slow. I already gave you some suggestions to make it a bit faster but you said that you couldn't make it work in some other unknown part of your code.

                    Now, how can you expect anybody to provide you with advices based on that ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    M 1 Reply Last reply 15 Nov 2017, 21:26
                    1
                    • S SGaist
                      15 Nov 2017, 21:19

                      Full uppercased words and many exclamation marks are not the best way to communicate when people are trying to help you on their own time.

                      You are only providing a small part of your code and stating that your users find it slow. I already gave you some suggestions to make it a bit faster but you said that you couldn't make it work in some other unknown part of your code.

                      Now, how can you expect anybody to provide you with advices based on that ?

                      M Offline
                      M Offline
                      mark_ua_1999
                      wrote on 15 Nov 2017, 21:26 last edited by mark_ua_1999
                      #16

                      @SGaist yes you are right sorry

                      1 Reply Last reply
                      0

                      16/16

                      15 Nov 2017, 21:26

                      • Login

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