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
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
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