Ver Mensaje Individual
  #5  
Antiguo 06-08-2007
Avatar de ArdiIIa
[ArdiIIa] ArdiIIa is offline
Miembro Premium
 
Registrado: nov 2003
Ubicación: Valencia city
Posts: 1.481
Reputación: 22
ArdiIIa Va por buen camino
Version 2

Revivo este antiguo hilo para comentar que me ha pasado lo mismo ahora mismo...

Resulta que no se puede asignar un nuevo valor de la tabla afectada en un trigger AFTER UPDATE.

Cita:
Why don't my triggers fire? For example, I have an AFTER UPDATE trigger that is supposed to update a flag: new.Flag = 'T'; but it never happens!
AFTER triggers cannot be used to set values on the row: the NEW values are read-only at this point.

A BEFORE action trigger fires before the action, followed by constraints, then the action, then AFTER triggers. If a posted operation is cancelled by a ROLLBACK, all of the actions, including the triggered actions, will be undone. The whole package -- BEFORE action triggers, action, and AFTER action triggers and any other changes caused by the changes -- is atomic, which means it will succeed or fail as a unit.
__________________
Un poco de tu generosidad puede salvar la vida a un niño. ASÍ DE SENCILLO
Responder Con Cita