Andrew_Manu

Modificar Stock

Jun 14th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.26 KB | None | 0 0
  1. use mydb;
  2. DELIMITER //
  3. CREATE PROCEDURE ModStock (IN name VARCHAR(20), IN cant INT)
  4. BEGIN
  5.     DECLARE aux INT;
  6.     SET aux =
  7.     (   select idProducto
  8.         from productos
  9.         where Nombre = name
  10.     );
  11.     UPDATE productos
  12.     SET Stock = cant
  13.     WHERE idProducto = aux;
  14. END; //
Advertisement
Add Comment
Please, Sign In to add comment