CSV to multiple tables update

J

Jose Lopes

I have access to a flat CSV file daily from where I query my stock data. This
way I was storing several tables on my DB and experiencing some difficulties.

TABLE [20080901]
Product warehouse1 warehouse2
123456789 50 50
987654321 15 10
012345678 5 5
753951456 12 12

Someone here at the forums told me that this was poor database design and I
should normalize this. So now I already created:

PRODUCTS
P_ID product
1 123456789
2 987654321
3 012345678
4 753951456

WHAREHOUSE
WH_ID warehouse
1 WH1
2 WH2

IMPORTDATES
DATE_ID dates
1 01-09-2008
2 03-09-2008
3 05-09-2008

STOCKS
STOCK_ID P_ID WH_ID DATE_ID STOCK
1 1 1 1 50
1 1 2 1 20

My problem now is how to keep on importing my data and update all these
linked tables… Can someone point me a method to try?

Thx in advance.
 
Top