Ver Mensaje Individual
  #6  
Antiguo 01-06-2012
MartinS MartinS is offline
Miembro
NULL
 
Registrado: nov 2011
Ubicación: Villa Cacique - Argentina
Posts: 283
Reputación: 13
MartinS Va por buen camino
Proba asi el trigger suponiendo que el valor Jid es el que se debe incrementar:

Código SQL [-]
CREATE TRIGGER T_INVERSION FOR DESARROLLO BEFORE INSERT POSITION 0 AS
begin
       If ((NEW.Jid is null) or (NEW.Jid = 0)) then
       NEW.Jid = GEN_ID(Gen_inversionistas_id,1);
end

Saludos

Edito: Juga con la condicion If porque no entendi bien si queres que se incremente cuando sean valores Null o no, en su caso (New.Jid is not null)

Última edición por MartinS fecha: 01-06-2012 a las 15:44:21.
Responder Con Cita