actlobi.blogg.se

See finance quote not updating
See finance quote not updating






My best guess is that the data provided above is somehow inconsistent with the actions taken. Why didn't the total update?Īs for the GOOG updates, I have no idea what's happening there. I'm not sure what's happening with the total because the phpliteadmin screenshot shows NULL. It would appear that it is setting each row's price to 215.05 three times. To drill down a little farther, let's look at the 3 AAPL rows. Hint: ON DUPLICATE UPDATE is your friend. On the other hand, if this is a portfolio table, then why are there multiple rows for each stock+user combination? In this case, the combination of those two fields should be used as a unique index and the row created if it doesn't exist, updated as stocks are bought and sold, and deleted if all stocks are sold.

see finance quote not updating

I'm thinking that if you get the ID field in the first select, then that's all you need to identify the row to be updated, since it is a unique field.Īs a side comment, if this is a transaction history table, then multiple rows for the same stock and user are appropriate, but then, why would anything in them need to be changed? Since you're allowing multiple rows with the same symbol for a given user, you need to update WHERE symbol =. In order to get this right, the code needs to select the exact row(s) to be modified. (Not sure what's going on with GOOG, maybe you did something previously to get the same data?) This SQL code says to update the price and total for EVERY row in the table that has the given symbol. "It did exactly what I said, but not what I wanted!" -)

see finance quote not updating

Here is what the debugger code shows(looks ok here): DEBUG:cs50:UPDATE test SET price=1207.33, total=6036.65 WHERE symbol='GOOG'ĭEBUG:nnectionpool:Starting new HTTPS connection (1): ĭEBUG:nnectionpool: "GET /1.0/stock/aapl/quote HTTP/1.1" 200 NoneĭEBUG:cs50:UPDATE test SET price=215.05, total=430.1 WHERE symbol='AAPL'ĭEBUG:cs50:UPDATE test SET price=215.05, total=645.1500000000001 WHERE symbol='AAPL'ĭEBUG:cs50:UPDATE test SET price=215.05, total=215.05 WHERE symbol='AAPL' What am i doing wrong with my loop? rows = db.execute("SELECT symbol, shares, price, total FROM test WHERE sessionid=:id", id=session)ĭb.execute("UPDATE test SET price=:price, total=:total WHERE symbol=:symbol", price=price, total=total, symbol=quote) In the table itself, price shows the same for all rows, while total remains blank. I seem to have it mostly correct, as values are being updated properly, however all rows in table are being updated instead of just one at a time.Īs screenshot shows, it seems i am going through the loop and all 4 rows are being updated 4 times instead of each row just once. I am trying to set up to update my price and total column in my sql table. $ sudo /Applications/Gnucash.First time asking question, sorry if formatted badly. $ sudo /usr/bin/cpan Mozilla::CA #Provides Mozilla's Cert library - NOT listed as a dependency by CPAN but gnc-fq-helper and gnc-fq-dump seem to need it $ sudo /usr/bin/cpan DateTime::Format::Strptime Here's how I got it working on my system - Macbook Pro with a clean install of Big Sur 11.5.1: $ sudo /usr/bin/cpan -T B::Keywords #The -T switch skips some tests which will fail without the Perl Headers First, one of the dependencies required by the script can't install because Apple moved Perl's header files to an unexpected location, and secondly there are some additional dependencies that Finance::Quote isnt aware of. There are two problems that Ive found in the original gnc-fq-update script supplied with GnuCash. Ok, thanks to the help of u/rahuldroy and u/NeutrinoDrive, I have finance::quote working on Big Sur. I've also tried installing Finance::Quote through homebrew, and it installs OK but Gnucash insists on using system perl, and can't see the good install of Finance::Quote. I've traced the issue back to B::Keywords, which needs to compile using Keywords.h. The script runs ok, but can't install several dependencies. It looks like apple has moved the Perl header files to a new location, and cpan isn't aware of the change. Has anyone had any success installing Finance::Quote on Mac OS Big Sur? Im working with a clean install of Big Sur, and cannot install Finance::Quote using the included script under the application bundle.








See finance quote not updating