Hi i am new to java, i am developing a POS application. I am using two database table (1)Stock- for maintaining the purchase and sell product transactions (2)Sold_product-- to keep the record of sold product.
Please help me, how can i subtract the number of sold item from the table of Stock
i.e Stock of coke bottle is 25, when manager sold 2 bottles out of them then the stock of coke deduced to 25-2=23 dynamically.
4 Replies - 8507 Views - Last Post: 22 July 2011 - 06:22 AM
#1
How to subtract no. of sold item from database 'stock' table t
Posted 21 July 2011 - 11:25 AM
Replies To: How to subtract no. of sold item from database 'stock' table t
#2
Re: How to subtract no. of sold item from database 'stock' table t
Posted 21 July 2011 - 12:33 PM
It depends on how you have made your database table.
You could use an UPDATE PreparedStatement, and update the number of coke bottles in your database if that's how you have made it.
You could use an UPDATE PreparedStatement, and update the number of coke bottles in your database if that's how you have made it.
#3
Re: How to subtract no. of sold item from database 'stock' table t
Posted 21 July 2011 - 10:04 PM
first select the row that contains your part number from your inventory database
subtract 1 from the quantity column
update that row with the new quantity
subtract 1 from the quantity column
update that row with the new quantity
#4
Re: How to subtract no. of sold item from database 'stock' table t
Posted 22 July 2011 - 01:21 AM
Page 1 of 1

New Topic/Question
Reply



MultiQuote







|