Gracias
egostar, aunque eso también es un problema, porque no encuentro el significado.
NO ACTION significa que al borrar en la tabla principal, ¿no hace nada en la tabla con clave ajena?... o sea, se quedaría un Id huérfano, si es así no me interesa.
De momento lo estoy solucionando así, aunque no me gusta:
Código SQL
[-]CREATE TRIGGER CATEGORIA_BD FOR CATEGORIA
ACTIVE BEFORE DELETE POSITION 0
as
declare variable cuantos integer;
begin
select first 1 idcategoria from Trabajador t
where t.Idcategoria = old.Idcategoria
into :cuantos;
if (cuantos > 0) then
exception NotdeleteCategoria;
end
Ya en delphi, en un ApplicationsEvents:
Código Delphi
[-]
if (e is EMDOError) then
if (e is EMDOFirebirdError) then
begin
Notifica(maviso, dtm.ParseError(EMDOError(E)));
end
ParseError, lo único que hace es quitar el texto "exception X" de la excepción.
Saludos.