Subject Re: [firebird-support] What's wrong with my Aft-Del-Trigger, can't create it in FB2
Author Helen Borrie
At 05:38 PM 1/01/2007, you wrote:
>Hi all
>
>Wishing you all a Very Happy New Year!!!
>
>I am trying to create a After Delete Trigger using FlameRobin 0.7.6
>but I cannot seem to be able to create the trigger. I keep getting
>the following error:
>Message: isc_dsql_prepare failed
>
>SQL Message : -104
>Invalid token
>
>Engine Code : 335544569
>Engine Message :
>Dynamic SQL Error
>SQL error code = -104
>Token unknown - line 10, column 37
>;
>
>My code is as follows:
>SET TERMINATOR ^ ;
>
>CREATE TRIGGER trg_aft_del_spackinglist_ustok FOR SPACKINGLIST
>ACTIVE AFTER DELETE POSITION 0
>AS
>BEGIN
>-- DELETE FROM uStock
>-- WHERE iPID = Old.iID;
>
> SELECT * FROM DelUStock(Old.iID);
>END^
>
>SET TERMINATOR ; ^
>
>I have successfully create the stored procedure DelUStock().

It is an illegal SELECT statement for PSQL. In PSQL, you have to
select <specific fields> INTO <an appropriate set of corresponding
variables>. What do you suppose a trigger can do with your select?

Explain what you want to do and we'll either show you how to do it,
or tell you that you can't do it in a trigger. :-)

./heLen