Subject | Re: [firebird-support] Custom RI was Re: Possible bug with CHECK constraint |
---|---|
Author | German Pablo Gentile |
Post date | 2004-10-03T23:16:42Z |
Martijn Tonies wrote:
http://www.ibphoenix.com/a418.htm?a=ibphoenix&s=1096838625:415171&page=ibp_intro_sp_trig
Fine, i write my first trigger, but it dont compile, and iu can see why not.
CREATE TRIGGER conductores_BDO FOR CONDUCTORES ACTIVE BEFORE DELETE
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
And i get :
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 6, char 23.
ANY.
All ids are valid, and ANY seems to be valid too.I dont understand that
i missed.
TIA.
German.
>You can - by raising an exception. Obviously, you need to catch thisI find a doc writed by Bill Todd with stored procedures and trigger details.
>exception in your client code as you would with a FK exception.
>
>You can create custom exceptions via
>CREATE EXCEPTION <name> '<message>'
>
>
>
http://www.ibphoenix.com/a418.htm?a=ibphoenix&s=1096838625:415171&page=ibp_intro_sp_trig
Fine, i write my first trigger, but it dont compile, and iu can see why not.
CREATE TRIGGER conductores_BDO FOR CONDUCTORES ACTIVE BEFORE DELETE
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
And i get :
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 6, char 23.
ANY.
All ids are valid, and ANY seems to be valid too.I dont understand that
i missed.
TIA.
German.