Looks like that approach could work, but I'm afraid I don't know enough about the inner workings of GnuCash to advise you authoritatively.

Good luck!


Regards

Geoff
=====

On 22/10/2021 11:52 pm, Public Address wrote:
Thanks, interesting that deleting the “NULL” text and leaving it empty allowed it to go through.

“but direct database manipulation may void your GnuCash warranty.”

I was thinking about direct upload to the postgres table (creating my own guid and checking for duplication) but that doesn’t sound like a good idea?

Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

*From: *Geoff <mailto:cleanoutmys...@gmail.com>
*Sent: *20 October 2021 11:15
*To: *Public Address <mailto:public.addr...@hotmail.co.uk>; David Carlson <mailto:david.carlson....@gmail.com>
*Cc: *gnucash-user@gnucash.org <mailto:gnucash-user@gnucash.org>
*Subject: *Re: [GNC] save as sqlite3 error

That would do it - the schema prohibits NULLs.

I don't believe it is possible to import securities, it is not an option
on the Import menu.  Depending how many you have, you could consider:-

Learning to script AutoHotKey - https://www.autohotkey.com/ <https://www.autohotkey.com/> - which is
excellent for automating Windows applications.

Or (big stretch) have a look at PieCash - the securities table is called
"commodities" -
https://github.com/sdementen/piecash/blob/master/piecash/core/commodity.py <https://github.com/sdementen/piecash/blob/master/piecash/core/commodity.py>
- but direct database manipulation may void your GnuCash warranty.

I reckon you will probably find it quicker to type them in yourself -
you can import price data from CSV once the securities themselves are
set up.

Hope this helps.

Regards

Geoff
=====



On 20/10/2021 7:25 pm, Public Address wrote:
 > Thank you all.  Someone last night pointed me to the trace file.  I
 > tried to save as sqlite3, failed then closed down.  The last lines are
 > as follows:
 >
 > * 17:59:21 ERROR <gnc.engine> gboolean qof_book_is_readonly(const
 > QofBook*): assertion 'book != NULL' failed
 > * 17:59:26 ERROR <gnc.backend.dbi> [error_handler()] DBI error: 19: NOT
 > NULL constraint failed: splits.memo
 > * 17:59:26 ERROR <gnc.backend.dbi>
 > [GncDbiSqlConnection::execute_nonselect_statement()] Error executing SQL
 > INSERT INTO
> splits(guid,tx_guid,account_guid,memo,action,reconcile_state,reconcile_date,value_num,value_denom,quantity_num,quantity_denom)
 > VALUES('[xxx]','[xxy]','[xxz]',NULL,'','c','2021-01-24
 > 17:57:12',46353,100,46353,100)
 > * 17:59:26 ERROR <gnc.backend.sql>
 > [GncSqlBackend::execute_nonselect_statement()] SQL error: INSERT INTO
> splits(guid,tx_guid,account_guid,memo,action,reconcile_state,reconcile_date,value_num,value_denom,quantity_num,quantity_denom)
 > VALUES('[xxx]','[xxy]','[xxz]',NULL,'','c','2021-01-24
 > 17:57:12',46353,100,46353,100)
 >
 > I am not sure how to look for transactions via the guid_tx, but I
 > searched for 463.53.  I was then shown a split transaction view of a
 > transaction that was put into the imbalance account.  The description
 > was “NULL” where the rectangle is in the attached.  Some of my other
 > imbalance entries had this entry, some did not.  So I removed them all
 > and now it writes.
 >
 > I don't believe I put these “NULL”s in, I think gnucash did it so might
 > be something to look into.
 >
 > Not sure if you saw my other question – can import securities (not the
 > security transactions) or can I only add them via the GUI?
 >
 > Many Thanks
 >
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986 <https://go.microsoft.com/fwlink/?LinkId=550986>> for Windows
 >
> *From: *Geoff <mailto:cleanoutmys...@gmail.com <mailto:cleanoutmys...@gmail.com>>
 > *Sent: *20 October 2021 04:29
> *To: *David Carlson <mailto:david.carlson....@gmail.com <mailto:david.carlson....@gmail.com>> > *Cc: *Public Address <mailto:public.addr...@hotmail.co.uk <mailto:public.addr...@hotmail.co.uk>>; > gnucash-user@gnucash.org <mailto:gnucash-user@gnucash.org <mailto:gnucash-user@gnucash.org>>
 > *Subject: *Re: [GNC] save as sqlite3 error
 >
 > Good pickup David - Thunderbird dropped the attachment, but I can see it
 > via Gmail  {:--(
 >
 > Not that it helps much PA, as John said, please check the trace file.
 >
 > Geoff
 > =====
 >
 > On 20/10/2021 2:04 pm, David Carlson wrote:
>  > It is odd that PA's screenshot made it to my Gmail account in Windows OS
 >  > when it did not get to Geoff's email client, or maybe it did but Geoff
>  > did not see it because for some reason there was an inline link as well
 >  > as an attachment at the end.  In either case I cannot comment on the
 >  > sqlite issue as I have no experience with that.  Did I see an email
>  > elsewhere suggesting that sometimes an incorrect version of some library
 >  > program was incorrectly selected by the installation program?
 >  >
 >  > On Tue, Oct 19, 2021 at 8:16 PM Geoff <cleanoutmys...@gmail.com
>  > <mailto:cleanoutmys...@gmail.com <mailto:cleanoutmys...@gmail.com <mailto:cleanoutmys...@gmail.com>>>>
 > wrote:
 >  >
 >  >     Hi PA
 >  >
 >  >     I can't help you with this error except to say that I am running
 > on the
>  >     same build on Windows 10 and cannot reproduce your problem. BUT I do
 >  >     not have Trading Accounts switched on.
 >  >
 >  >     I successfully saved a 35MB XML file to SQLite and can access
 > that file
>  >     in both GnuCash and the SQLite DB Browser.  See attached screenshot.
 >  >
 >  >     (Your screenshot didn't come through - try attaching instead of
 >  >     pasting).
 >  >
>  >     Have you tried debugging: https://wiki.gnucash.org/wiki/Logging <https://wiki.gnucash.org/wiki/Logging> > <https://wiki.gnucash.org/wiki/Logging <https://wiki.gnucash.org/wiki/Logging>>
 >  >     <https://wiki.gnucash.org/wiki/Logging
> <https://wiki.gnucash.org/wiki/Logging <https://wiki.gnucash.org/wiki/Logging>>>
 >  >
 >  >     Start gnucash.exe from the command line with the "--debug"
 > switch.  In
 >  >     my case, the log files are called gnucash.traceXXXXXX.log in
 >  >     ~\AppData\Local\Temp
 >  >
 >  >     Being Windows, perhaps a reboot may help?
 >  >
 >  >     Good luck.
 >  >
 >  >     Regards
 >  >
 >  >     Geoff
 >  >     =====
 >  >
 >  >     On 19/10/2021 6:27 pm, Public Address wrote:
 >  >      > Hi - In xml format
 >  >      >
>  >      > Trying to save as sqlite3 getting error when file gets to 213kb.
 >  >     Plenty of room on disk.  I have tried different drives, different
 >  >     filenames no luck.
 >  >      >
 >  >      > [cid:image001.png@01D7C4C2.F1FEDBF0]
 >  >      >
 >  >      >
 >  >      > Many thanks
 >  >      >
 >  >      > Windows 10
 >  >      > GNU      4.8
 >  >      > Build ID 4.8a+ (2021-09-28)
 >  >      > Finance::Quote 1.49
 >  >      >
 >  >      > Trading Accounts: on
 >  >      >
 >  >      > Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986
 >  >     <https://go.microsoft.com/fwlink/?LinkId=550986
> <https://go.microsoft.com/fwlink/?LinkId=550986 <https://go.microsoft.com/fwlink/?LinkId=550986>>>> for Windows
 >  >      >
 >  >      >
 >  >      >
 >  >      > _______________________________________________
 >  >      > gnucash-user mailing list
 >  >      > gnucash-user@gnucash.org <mailto:gnucash-user@gnucash.org
 > <mailto:gnucash-user@gnucash.org <mailto:gnucash-user@gnucash.org>>>
 >  >      > To update your subscription preferences or to unsubscribe:
>  >      > https://lists.gnucash.org/mailman/listinfo/gnucash-user <https://lists.gnucash.org/mailman/listinfo/gnucash-user> > <https://lists.gnucash.org/mailman/listinfo/gnucash-user <https://lists.gnucash.org/mailman/listinfo/gnucash-user>>
 >  >     <https://lists.gnucash.org/mailman/listinfo/gnucash-user
> <https://lists.gnucash.org/mailman/listinfo/gnucash-user <https://lists.gnucash.org/mailman/listinfo/gnucash-user>>>
 >  >      > If you are using Nabble or Gmane, please see
>  > https://wiki.gnucash.org/wiki/Mailing_Lists <https://wiki.gnucash.org/wiki/Mailing_Lists> > <https://wiki.gnucash.org/wiki/Mailing_Lists <https://wiki.gnucash.org/wiki/Mailing_Lists>>
 >  >     <https://wiki.gnucash.org/wiki/Mailing_Lists
> <https://wiki.gnucash.org/wiki/Mailing_Lists <https://wiki.gnucash.org/wiki/Mailing_Lists>>> for more information.
 >  >      > -----
 >  >      > Please remember to CC this list on all your replies.
 >  >      > You can do this by using Reply-To-List or Reply-All.
 >  >      > _______________________________________________
 >  >     gnucash-user mailing list
 >  >     gnucash-user@gnucash.org <mailto:gnucash-user@gnucash.org
 > <mailto:gnucash-user@gnucash.org <mailto:gnucash-user@gnucash.org>>>
 >  >     To update your subscription preferences or to unsubscribe:
>  > https://lists.gnucash.org/mailman/listinfo/gnucash-user <https://lists.gnucash.org/mailman/listinfo/gnucash-user> > <https://lists.gnucash.org/mailman/listinfo/gnucash-user <https://lists.gnucash.org/mailman/listinfo/gnucash-user>>
 >  >     <https://lists.gnucash.org/mailman/listinfo/gnucash-user
> <https://lists.gnucash.org/mailman/listinfo/gnucash-user <https://lists.gnucash.org/mailman/listinfo/gnucash-user>>>
 >  >     If you are using Nabble or Gmane, please see
>  > https://wiki.gnucash.org/wiki/Mailing_Lists <https://wiki.gnucash.org/wiki/Mailing_Lists> > <https://wiki.gnucash.org/wiki/Mailing_Lists <https://wiki.gnucash.org/wiki/Mailing_Lists>>
 >  >     <https://wiki.gnucash.org/wiki/Mailing_Lists
> <https://wiki.gnucash.org/wiki/Mailing_Lists <https://wiki.gnucash.org/wiki/Mailing_Lists>>> for more information.
 >  >     -----
 >  >     Please remember to CC this list on all your replies.
 >  >     You can do this by using Reply-To-List or Reply-All.
 >  >
 >  >
 >  >
 >  > --
 >  > David Carlson
 >

_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to