Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/11/2012, 09:28
jose920405
 
Fecha de Ingreso: noviembre-2012
Ubicación: Cali - Colombia
Mensajes: 46
Antigüedad: 11 años, 5 meses
Puntos: 0
Respuesta: Update Entre tablas

Cita:
Iniciado por joeglo Ver Mensaje
Hola el problema, creo que se tiene que solucionar añadiendo el WHERE correspondiente el UPDATE, ya que si no lo añades estas actualizando todos los ingredientes. Quedaría así:
UPDATE Ingrediente a
SET a.Cantidad = NVL(a.Cantidad -(SELECT b.Cantidad FROM Receta b WHERE b.CodigoIngrediente =a.CodigoIngrediente
AND b.CodigoProducto=100),0)
WHERE a.CodigoIngrediente IN (SELECT c.CodigoIngrediente FROM Receta c WHERE c.CodigoProducto=100)

Muchas Gracias Man esta fue la solución. Te agradezco mucho