Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
241 views
in Technique[技术] by (71.8m points)

mysql - i am trying to update quantity of product when order is placed but sql is returning garbage value when trying to fetch current value

product table orderitem table

    BEGIN
    DECLARE var integer;
    SELECT stock INTO var FROM product WHERE pno = new.pid;
    UPDATE product SET s=var,product.stock= var - new.quantity WHERE pno = 
    new.pid;
    END

i am trying to update quantity of product when order is placed but sql is returning garbage value when trying to fetch current value


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...