Subject | Re: [firebird-support] This trigger |
---|---|
Author | Ann W. Harrison |
Post date | 2006-07-05T15:22:09Z |
ShepherdHill DB Subscriptions wrote:
FROM pool p
WHERE p.matric = NEW.matric
INTO NEW.nama
using table aliases avoids many mistakes that are easy to
make and hard to find.
Regards,
Ann
>CREATE TRIGGER HALL_ALL_NAMA FOR HALL_ALLOCATION ACTIVE
> What am I doing wrong here?
>
> ----
> SET TERM ^ ;
> CREATE TRIGGER HALL_ALL_NAMA ACTIVE
> BEFORE INSERT POSITION 0SELECT p.nama
> AS
> BEGIN
> NEW.nama = (SELECT nama FROM pool WHERE matric = NEW.matric);
FROM pool p
WHERE p.matric = NEW.matric
INTO NEW.nama
> END^When you have overlapping field names in different tables,
> SET TERM ; ^
> ----
using table aliases avoids many mistakes that are easy to
make and hard to find.
Regards,
Ann