Ver Mensaje Individual
  #1  
Antiguo 26-02-2015
alexglez1255 alexglez1255 is offline
Miembro
NULL
 
Registrado: jul 2013
Posts: 86
Reputación: 11
alexglez1255 Va por buen camino
problema con un trigger

tengo una tabla de clientes con dos campos que deseo autoincrementarlos
1 consecutivo tipo integer
2 cod_cliente tipo integer
el 1 genere un trigger y generador y lo creo sin ningun problema,

pero a la hora de crear el segundo me manda el siguiente error
aun despues de haber cambiado el nombre del generador, alguien sabe porque
Código SQL [-]
create trigger clientes_bi for clientes
active before insert position 0
as
begin
  if (new.cod_cliente is null) then
    new.cod_cliente = gen_id(gen_clientes_codcli,1);
end
This operation is not defined for system tables.
unsuccessful metadata update.
DEFINE TRIGGER failed.
attempt to store duplicate value (visible to active transactions) in unique index "RDB$INDEX_8".

Última edición por nlsgarcia fecha: 26-02-2015 a las 04:01:07. Razón: Sintaxis SQL
Responder Con Cita