Subject Re: [firebird-support] Computing column in BEFORE INSERT trigger
Author Michael Ludwig
Alec Swan schrieb am 21.12.2010 um 11:30 (-0700):
> Why do I get a syntax error when running the following?
>
> CREATE TRIGGER Source_Id_Upd FOR PHYSICAL_COPY
> BEFORE INSERT OR UPDATE
> AS BEGIN
> NEW.source_id = (select source_id from copy where id = NEW.COPY_ID);
> END;

SET TERM ^; -- set delimiter
CREATE TRIGGER ...
AS BEGIN
NEW.source_id = ... ;
END ^
SET TERM ;^ -- back to normal

> I know I could use computed columns, but I need that column to be
> indexed.

Can't say. Might make sense the way you do it.

--
Michael Ludwig