Ver Mensaje Individual
  #4  
Antiguo 01-06-2004
Avatar de jzginez
jzginez jzginez is offline
Miembro
 
Registrado: sep 2003
Ubicación: Puebla, México
Posts: 247
Reputación: 21
jzginez Va por buen camino
Hola a todos esperando que la falta de respuesta sea porque no escribi el codigo dentro de las etiquetas correspondientes reescribo el codigo
Código SQL [-]
CREATE TRIGGER TOPERESTILO_AI FOR TOPERESTILO
ACTIVE AFTER INSERT POSITION 0
AS
declare variable tiempoOper time;
declare variable TiempoEstilo time;
declare variable tiempoTotal Integer;
begin
/* Trigger text */
if (new.id_oper is not null)
  Then begin
    select minutaje from toperaciones where id = new.id_oper into :TiempoOper;
    select minutaje from testilo where id = new.id_estilo into TiempoEstilo;
    tiempoTotal = extract(hour from TiempoEstilo)*3600 + extract(minute from TiempoEstilo)*60 + extract(second from TiempoEstilo);
    tiempototal = TiempoTotal + extract(hour from TiempoOper)*3600 + extract(minute from TiempoOper)*60 + extract(second from TiempoOper);  
    update testilo set minutaje = :tiempoTotal where id = new.id_estilo;
   end
end

lo último que he intentado es

Código SQL [-]
CREATE TRIGGER TOPERESTILO_AI FOR TOPERESTILO
ACTIVE AFTER INSERT POSITION 0
AS
declare variable preciotemp float;
declare variable tiempo1 time;
declare variable tiempo2 time;
begin
  /* Trigger text */
  if (new.id_oper is not null)
   Then begin
  select pagooper, minutaje from toperaciones where id = new.id_oper into reciotemp, :tiempo1;
  update testilo set precio = precio + reciotemp where id = new.id_estilo;
  select minutaje from testilo where id = new.id_estilo into :tiempo2;
  if (tiempo2 is null)
   then update testilo set minutaje = :tiempo1 where id = new.id_estilo;
  else update testilo set minutaje = minutaje + :tiempo1 where id = new.id_estilo;
  end
end


pero me indica el siguiente error que segun yo es en el if
Código PHP:
Unsuccessful execution caused by a system error that precludes
successful execution of subsequent statements
.
Dynamic SQL Error.
expression evaluation not supported
espero me puedan ayudar gracias
__________________
Espero poder seguir exprimiéndote el cerebro 8)
Jorge Zamora Ginez
Puebla, Pue. México
Responder Con Cita