Hi all, i m making a little website for a store, and it have a stock control table.. so i m using a table with the following fields:
code, product_code, action(add or remove), quantity and actual_stock
its kinda simple, but my problem is.. my table data is like this:
code, pro_code, action, quantity, actual_stock
1, 01, A, 10, 0
2, 01, R, 1, 9
3, 01, R, 1, 8
4, 01, R, 1, 7
5, 01, R, 2, 5
but my problem is... i have to somethimes remove a row, and i have to rewrite all the atual_stock of the product.. like, if i remove the second entry.. i have to do it:
code, pro_code, action, quantity, actual_stock
1, 01, A, 10, 0
Remove this ->2, 01, R, 1, 9
Update this ->3, 01, R, 1, 9
Update this ->4, 01, R, 1, 8
Update this ->5, 01, R, 2, 6
So the new actual stock for product 01 is 06 and not 05...
btw. i cant figure out how to do it with firebird, i tried to think in a solution but there are too many stuff to update.. as i m noob in databasesi dont know how 🙁
Please, any help and ideas are welcome 😃
thanx in advance