Please review Stockalyze: https://g.page/r/CYw4g9KFTD6FEAI/review.

SQL to edit database

Started by Tony, March 14, 2024, 09:46:58 AM

Previous topic - Next topic

Tony

Hi Sacha.
First and foremost, thank you for continuing to improve Stockalyze. It is greatly appreciated.

Now here is my question:
When I began using Stockalyze, I didn't know much about what I was doing and some stocks got entered without the exchange name, so it has "UNKNOWN" for the exchange. I have since corrected my mistake, but now I have a large amount of duplicate tables for some symbols.
 
One with the correct exchange name and another with "UNKNOWN".

I use SQL Lite.
I know some SQL, but only enough to be dangerous. I have tried to Google my question, but have failed to find the solution.

What would the SQL syntax be to delete all tables with "UNKNOWN" in its name?
Or is this something that should be left alone?

Thanks,
Tony

Sacha

Hi Tony,
Sorry for late response. I had read your query but it slipped off my mind to respond earlier.
If I have understood your question correctly then you want to correct the exchange names of the stock symbols you had added to the Stockalyze. If that is so then please read on.

You don't actually need to manipulate the Stockalyze database. You can just delete the price-hist.lyzdb, it will get automatically created again, but before you do that you should close the Stockalyze first. This file is places in "%localappdata%\Lunetek Software\Stockalyze\data".
And before starting Stockalyze again then delete all files in "%appdata%\Lunetek Software\Stockalyze\yahoo_data_download\user_index". This path is for yahoo symbols, if you had added symbols for other data providers then change the path accordingly.
Now, start the Stockalyze and add your symbols again.

If you follow these steps then all the price history will be downloaded from start whenever they will be needed. In case you care about that or you want to take shortcuts you can do other things. Like instead of deleting all files in "%appdata%\Lunetek Software\Stockalyze\yahoo_data_download\user_index" you modify them, they are just text files. You can even create new files. You can copy the file names from "%programfiles(x86)%\Lunetek Stockalyze\data\yahoo_data_downloader".
You can freely delete the tables or their entries in price-hist.lyzdb. You can take backup of this file before you do that.

Please let me know if you need help.


Happy Stockalyzing.
Stockalyze Support
Let's be friends

Tony

Thank you for the response.

I had forgotten about removing the .lyzdb file. You had me do that in the beginning for some other troubles I was having.

Worked perfect.

I'm a happy camper now.

Tony