Tema: sql y mysql
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/07/2015, 11:24
Yhef
 
Fecha de Ingreso: junio-2015
Mensajes: 3
Antigüedad: 8 años, 10 meses
Puntos: 0
sql y mysql

alguien me podría ayudar a convertir estos triggers urgente de sql a mysql porfavor es urgente

Código SQL:
Ver original
  1. CREATE TRIGGER subtotal
  2. ON detaped
  3. FOR INSERT
  4. AS
  5. UPDATE detaped SET subtotal=precioventa*cantidad
  6. GO
  7.  
  8. CREATE TRIGGER tg_act_Totales
  9. ON detaped
  10. FOR INSERT
  11. AS
  12. UPDATE pedido SET montopedido=(SELECT SUM(dp.subtotal)
  13. FROM detaped dp
  14. WHERE Pedido.IdPed=dp.Idped)
  15. GO
  16.  
  17.  
  18. CREATE TRIGGER tr_003
  19. ON detafact
  20. FOR INSERT
  21. AS
  22. UPDATE factura SET factura.igv = factura.subtotal * 0.18
  23.  
  24. CREATE TRIGGER tr_004
  25. ON detafact
  26. FOR INSERT
  27. AS
  28. UPDATE factura SET factura.total = factura.subtotal + factura.igv