Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE DEFINER=`root`@`localhost` TRIGGER `desarrollo`.`producto_AFTER_INSERT` AFTER INSERT ON `producto` FOR EACH ROW
- BEGIN
- SET SQL_SAFE_UPDATES = 0;
- INSERT INTO inventario(stock, producto_id, sucursal_id, habilitado)
- SELECT 0, NEW.id, sucursal.id, 1
- FROM sucursal;
- SET SQL_SAFE_UPDATES=1;
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement