i want to insert values in a table by using procedure
i have 2 tables sales and products in a product table i have id , product_name,product_price,
product_quantity and in sales table i have p_id and p_qty
by using procedure when a user add values in a sales table procedure take
2 arguements 1 for p_id and other for p_qty
if p_qty is less than 0 or greater than product_quantity than showstock not available
i want answer if above statement
by using procedure when a user add values in a sales table procedure take
2 arguements 1 for p_id and other for p_qty
if p_qty is less than 0 or greater than product_quantity than showstock not available
2
Answers
here is my query
product_qty_proc > products.product_quantity
needs to refer to a specific row in theproducts
table in a query. You can use a subquery to select the quantity forproduct_id_proc
. Replace that condition with:Also,
product_qty_proc>0
should beproduct_qty_proc<0
.