Menu

#1026 Error Deleting Stock Transaction

1.4.0
closed
Stefano
3
2017-05-20
2017-03-21
IanMackers
No

I created a new share transaction by clicking 'duplicate' on the first transaction added againts the stock.

Trying to delete this new transction throws up the error below (also see attached image) and does not delete:

invalid vector<T> subscript

1 Attachments

Related

Bugs: #1026

Discussion

  • Stefano

    Stefano - 2017-03-22
    • assigned_to: Stefano
    • Group: 1.3.0 --> 1.4.0
     
  • Stefano

    Stefano - 2017-03-22

    Creating duplicates of Stock transactions was not implemented, but was not prevented as an oversite. Shall investigate further. Thanks for the report.

     
  • IanMackers

    IanMackers - 2017-04-06

    Thanks Stefano
    Any idea as to how I can get rid of this transaction that throws up the error?
    ThanksIan
    -------- Original message --------From: Stefano stef145g@users.sf.net Date: 22/03/2017 08:39 (GMT+00:00) To: "[moneymanagerex:bugs]" 1026@bugs.moneymanagerex.p.re.sf.net Subject: [moneymanagerex:bugs] #1026 Error Deleting Stock Transaction

    assigned_to: Stefano
    Group: 1.3.0 --> 1.4.0
    Comment:

    Creating duplicates of Stock transactions was not implemented, but was not prevented as an oversite. Shall investigate further. Thanks for the report.

    [bugs:#1026] Error Deleting Stock Transaction
    Status: open

    Group: 1.4.0

    Labels: share stock

    Created: Tue Mar 21, 2017 10:47 PM UTC by IanMackers

    Last Updated: Tue Mar 21, 2017 10:47 PM UTC

    Owner: Stefano

    Attachments:

    Capture.JPG (22.5 kB; image/jpeg)

    I created a new share transaction by clicking 'duplicate' on the first transaction added againts the stock.
    Trying to delete this new transction throws up the error below (also see attached image) and does not delete:

    invalid vector<T> subscript

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/moneymanagerex/bugs/1026/
    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     
  • Stefano

    Stefano - 2017-04-11

    A fix has been provided for this issue in GitHub: https://github.com/moneymanagerex/moneymanagerex/pull/1121

    This disables the Duplicate button. The duplicate option on the popup menu was disabled.

    As for removing the error, this requires removal of the entry by using sql commands.

    We need to determine the share account ID
    select ACCOUNTNAME, ACCOUNTID from ACCOUNTLIST_V1
    where ACCOUNTTYPE = "Shares";

    This tells us the correct linkages
    select ca.TRANSID, ca.ACCOUNTID, ca.TOACCOUNTID
    from CHECKINGACCOUNT_V1 ca, SHAREINFO_V1 si
    where ca.TRANSID = si.CHECKINGACCOUNTID;

    With this we can determine the extra transaction that needs to be deleted
    select ACCOUNTID, TRANSID, TOACCOUNTID from CHECKINGACCOUNT_V1
    where ACCOUNTID = ?;

    We can then create a database debug command to fix the error.

     

    Last edit: Stefano 2017-04-11
    • IanMackers

      IanMackers - 2017-04-23

      Hi Stefano
      I have run some test queries on the report manager and found the ACCOUNTID that needs deleting is 16.
      I have tried to 'Run' the following in the report manager but get an error: WXSQLITE_ERROR[1000]: Statement not accessible

      delete from CHECKINGACCOUNT_V1 where ACCOUNTID = 16;
      delete from ACCOUNTLIST_V1 where ACCOUNTID = 16;

      How am I able to run these delete queries above to remove this bad record?
      ThanksIan

        From: Stefano <stef145g@users.sf.net>
      

      To: 1026@bugs.moneymanagerex.p.re.sf.net
      Sent: Tuesday, 11 April 2017, 1:35
      Subject: [moneymanagerex:bugs] #1026 Error Deleting Stock Transaction

      A fix has been provided for this issue in GitHub: https://github.com/moneymanagerex/moneymanagerex/pull/1121This disables the Duplicate button. The duplicate option on the popup meny was disabled.As for removing the error, this requires removal of the entry by using sql commands.We need to determine the share account ID
      select ACCOUNTNAME, ACCOUNTID from ACCOUNTLIST_V1
      where ACCOUNTTYPE = "Shares";This tells us the correct linkages
      select ca.TRANSID, ca.ACCOUNTID, ca.TOACCOUNTID
      from CHECKINGACCOUNT_V1 ca, SHAREINFO_V1 si
      where ca.TRANSID = si.CHECKINGACCOUNTID;With this we can determine the extra transaction that needs to be deleted
      select ACCOUNTID, TRANSID, TOACCOUNTID from CHECKINGACCOUNT_V1
      where ACCOUNTID = ?;We can then create a database debug command to fix the error. [bugs:#1026] Error Deleting Stock TransactionStatus: open
      Group: 1.4.0
      Labels: share stock
      Created: Tue Mar 21, 2017 10:47 PM UTC by IanMackers
      Last Updated: Wed Mar 22, 2017 08:39 AM UTC
      Owner: Stefano
      Attachments:
      - Capture.JPG (22.5 kB; image/jpeg)
      I created a new share transaction by clicking 'duplicate' on the first transaction added againts the stock.Trying to delete this new transction throws up the error below (also see attached image) and does not delete:
      invalid vector<T> subscript
      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/moneymanagerex/bugs/1026/To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1026

      • James

        James - 2017-04-23

        The SQL delete command (and others like update) will cause that error. You will need to issue the command in a database utility like "DB Browser for SQLite" or modify and rebuild the code. There is a check to insure that the SQL command is read only in line 246 in of "Model_Report.cpp" file. (I might be off a little on the line as I am not looking at the latest code.)

        James

        From: "IanMackers" ianmackers@users.sf.net
        To: "[moneymanagerex:bugs]" 1026@bugs.moneymanagerex.p.re.sf.net
        Sent: Sunday, April 23, 2017 5:09:53 AM
        Subject: [moneymanagerex:bugs] Re: #1026 Error Deleting Stock Transaction

        Hi Stefano
        I have run some test queries on the report manager and found the ACCOUNTID that needs deleting is 16.
        I have tried to 'Run' the following in the report manager but get an error: WXSQLITE_ERROR [1000] : Statement not accessible

        delete from CHECKINGACCOUNT_V1 where ACCOUNTID = 16;
        delete from ACCOUNTLIST_V1 where ACCOUNTID = 16;

        How am I able to run these delete queries above to remove this bad record?
        ThanksIan
        From: Stefano stef145g@users.sf.net

        To: 1026@bugs.moneymanagerex.p.re.sf.net
        Sent: Tuesday, 11 April 2017, 1:35
        Subject: [moneymanagerex:bugs] #1026 Error Deleting Stock Transaction

        A fix has been provided for this issue in GitHub: [ https://github.com/moneymanagerex/moneymanagerex/pull/1121This | https://github.com/moneymanagerex/moneymanagerex/pull/1121This ] disables the Duplicate button. The duplicate option on the popup meny was disabled.As for removing the error, this requires removal of the entry by using sql commands.We need to determine the share account ID
        select ACCOUNTNAME, ACCOUNTID from ACCOUNTLIST_V1
        where ACCOUNTTYPE = "Shares";This tells us the correct linkages
        select ca.TRANSID, ca.ACCOUNTID, ca.TOACCOUNTID
        from CHECKINGACCOUNT_V1 ca, SHAREINFO_V1 si
        where ca.TRANSID = si.CHECKINGACCOUNTID;With this we can determine the extra transaction that needs to be deleted
        select ACCOUNTID, TRANSID, TOACCOUNTID from CHECKINGACCOUNT_V1
        where ACCOUNTID = ?;We can then create a database debug command to fix the error. [ https://sourceforge.net/p/moneymanagerex/bugs/1026/ | [bugs:#1026] ] Error Deleting Stock TransactionStatus: open
        Group: 1.4.0
        Labels: share stock
        Created: Tue Mar 21, 2017 10:47 PM UTC by IanMackers
        Last Updated: Wed Mar 22, 2017 08:39 AM UTC
        Owner: Stefano
        Attachments:
        - Capture.JPG (22.5 kB; image/jpeg)
        I created a new share transaction by clicking 'duplicate' on the first transaction added againts the stock.Trying to delete this new transction throws up the error below (also see attached image) and does not delete:
        invalid vector<T> subscript
        Sent from sourceforge.net because you indicated interest in [ https://sourceforge.net/p/moneymanagerex/bugs/1026/To | https://sourceforge.net/p/moneymanagerex/bugs/1026/To ] unsubscribe from further messages, please visit [ https://sourceforge.net/auth/subscriptions/ | https://sourceforge.net/auth/subscriptions/ ]

        [ https://sourceforge.net/p/moneymanagerex/bugs/1026/ | [bugs:#1026] ] Error Deleting Stock Transaction

        Status: open
        Group: 1.4.0
        Labels: share stock
        Created: Tue Mar 21, 2017 10:47 PM UTC by IanMackers
        Last Updated: Tue Apr 11, 2017 12:33 AM UTC
        Owner: Stefano
        Attachments:

        * [ https://sourceforge.net/p/moneymanagerex/bugs/1026/attachment/Capture.JPG | Capture.JPG ] (22.5 kB; image/jpeg)
        

        I created a new share transaction by clicking 'duplicate' on the first transaction added againts the stock.

        Trying to delete this new transction throws up the error below (also see attached image) and does not delete:

        invalid vector<T> subscript

        Sent from sourceforge.net because you indicated interest in [ https://sourceforge.net/p/moneymanagerex/bugs/1026/ | https://sourceforge.net/p/moneymanagerex/bugs/1026/ ]

        To unsubscribe from further messages, please visit [ https://sourceforge.net/auth/subscriptions/ | https://sourceforge.net/auth/subscriptions/ ]

         

        Related

        Bugs: #1026

  • Stefano

    Stefano - 2017-04-23

    I have attached 2 files. These contain sql commands.
    The file: stock_error_check.mmdbg is used to check your data.
    The file: stock_error_patch.mmdbg is used to correct the data.

    Use the command:Tools --> Database --> Database-Debug

    The command that you used to find the account ID is good, but this is NOT the record to be deleted.
    From the information given I was able to complete the chech file as I now know that the account is 16

    The 2nd and 3rd commands use the account ID to determine the faulty transaction record that needs to be deleted from CHECKINGACCOUNT_V1 table.

    The extra record found in the 3rd result will give you the TRANSID as the first item on the line.

    In the file: stock_error_patch.mmdbg change the ? in the file to the correct record then run the file.

    If you are unsure, post the results of the check file and I will correct the patch file for you to use.

     
    • IanMackers

      IanMackers - 2017-04-23

      Nice one. All went through okay once I updated the patch file with the correct TRANSID.
      Thanks for the assistance.

      ThanksIan

        From: Stefano <stef145g@users.sf.net>
      

      To: 1026@bugs.moneymanagerex.p.re.sf.net
      Sent: Sunday, 23 April 2017, 14:45
      Subject: [moneymanagerex:bugs] #1026 Error Deleting Stock Transaction

      I have attached 2 files. These contain sql commands.
      The file: stock_error_check.mmdbg is used to check your data.
      The file: stock_error_patch.mmdbg is used to correct the data.Use the command:Tools --> Database --> Database-DebugThe command that you used to find the account ID is good, but this is NOT the record to be deleted.

      From the information given I was able to complete the chech file as I now know that the account is 16The 2nd and 3rd commands use the account ID to determine the faulty transaction record that needs to be deleted from CHECKINGACCOUNT_V1 table. The extra record found in the 3rd result will give you the TRANSID as the first item on the line.In the file: stock_error_patch.mmdbg change the ? in the file to the correct record then run the file.If you are unsure, post the results of the check file and I will correct the patch file for you to use.Attachments:
      - stock_error_check.mmdbg (348 Bytes; text/plain)
      - stock_error_patch.mmdbg (80 Bytes; text/plain)
      [bugs:#1026] Error Deleting Stock TransactionStatus: open
      Group: 1.4.0
      Labels: share stock
      Created: Tue Mar 21, 2017 10:47 PM UTC by IanMackers
      Last Updated: Tue Apr 11, 2017 12:33 AM UTC
      Owner: Stefano
      Attachments:
      - Capture.JPG (22.5 kB; image/jpeg)
      I created a new share transaction by clicking 'duplicate' on the first transaction added againts the stock.Trying to delete this new transction throws up the error below (also see attached image) and does not delete:
      invalid vector<T> subscript
      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/moneymanagerex/bugs/1026/To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • Stefano

    Stefano - 2017-05-20
    • status: open --> closed
     

Log in to post a comment.