Ver Mensaje Individual
  #5  
Antiguo 04-08-2004
Avatar de jachguate
jachguate jachguate is offline
Miembro
 
Registrado: may 2003
Ubicación: Guatemala
Posts: 6.254
Reputación: 28
jachguate Va por buen camino
Cool

Te funcionaría:

Código SQL [-]
Create Trigger Detalle_servmaqtrigger1 
   for Detalle_ServMaq 
 After update
       Position 0 

AS

Declare Variable SalidasDet TipoDato;
Declare Variable CantidadDet TipoDato;
Declare Variable KeyEnt TipoDato;

Begin
  Cantidad = new.Cantidad_ServMaq;
  for Select Salidas_DetEnt, Cantidad_DetEnt, Key_DetEnt
        from Detalle_Entradas
       where Key_Material = New.Key_Material
         and ((Cantidad_DetEnt - SalidasDetEnt) > 0) 
       order by fecha_Detent
        into :SalidasDet, :CantidadDet, KeyEnt 
  do
    CualquierCosa;
end

También he declarado las variables, sin las que no funcionaría. Por supuesto que lo he hecho en el bloc de notas, asi que podria tener errores... pero la idea es esa.

(por cierto.... esta vez, he usado la etiqueta [sql], por ello es que la sintaxis está resaltada.

Hasta luego.

__________________
Juan Antonio Castillo Hernández (jachguate)
Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate
Responder Con Cita