Subject | Re: [firebird-support] Trigger trouble when moving DB script from FB 1.5 to FB 2.0, please help. |
---|---|
Author | Milan Babuskov |
Post date | 2009-03-17T18:13:09Z |
Chuck Belanger wrote:
2.0 prevents you from thinking your code does something while it really
has no effect.
Looks like your database has subtle logic bugs you were not aware of
until now.
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com
> CREATE TRIGGER CUSTOM_VIEW_AI0 FOR CUSTOM_VIEWChanging the value for NEW.something in AFTER trigger has no effect. FB
> ACTIVE AFTER INSERT POSITION 0
> AS
> begin
> /* auto fill the Orig_CV_ID field when adding a new item */
> IF (NEW.ORIG_CV_ID IS NULL) THEN
> New.ORIG_CV_ID = New.CV_ID;
> end
> ;
2.0 prevents you from thinking your code does something while it really
has no effect.
Looks like your database has subtle logic bugs you were not aware of
until now.
> The next statement causes the following error:Maybe you wanted: OLD.TABLE_ID instead of OLD_TABLE_ID ?
>
> Column does not belong to referenced table.
> Dynamic SQL Error.
> SQL error code = -206.
> Column unknown.
> OLD_TABLE_ID.
> At line 6, column 19.
> *******************************************************************************/
> CREATE TRIGGER CV_TABLE_AI0 FOR CV_TABLE
> ACTIVE AFTER INSERT POSITION 0
> AS
> begin
> /* auto fill the Old_ID field when adding a new item */
> IF (OLD_TABLE_ID IS NULL) THEN
> OLD_TABLE_ID = CV_TABLE_ID;
> end
> ;
--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com