Subject | Re: [firebird-support] Custom RI was Re: Possible bug with CHECK constraint |
---|---|
Author | German Pablo Gentile |
Post date | 2004-10-04T00:20:59Z |
German Pablo Gentile wrote:
if (EXISTS
(SELECT IDBOMBA FROM DESPACHADO
WHERE DESPACHADO.IDBOMBA = bombas.idbomba)
)
then
begin
exception ex_despachado_bomba;
end
Theres any more eficient way to do that? the query takes a seconds
before result. I solve my insert troubles in despachado but have a not
liked delay deleting foreign records.
TIA
German.
>CREATE TRIGGER conductores_BDO FOR CONDUCTORES ACTIVE BEFORE DELETEMy sintax was wrong. That work:
>POSITION 0
>AS
>begin
> /* Trigger text */
> if (OLD_IDCONDUCTOR ANY
> (SELECT IDCONDUCTOR FROM DESPACHADO WHERE IDCONDUCTOR =
>OLD_IDCONDUCTOR)
> ) then
> begin
> exception EX_DESPACHADO_VEHICULO;
> suspend;
> end;
>end
>
>
>
if (EXISTS
(SELECT IDBOMBA FROM DESPACHADO
WHERE DESPACHADO.IDBOMBA = bombas.idbomba)
)
then
begin
exception ex_despachado_bomba;
end
Theres any more eficient way to do that? the query takes a seconds
before result. I solve my insert troubles in despachado but have a not
liked delay deleting foreign records.
TIA
German.