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; EN