Subject RE: [firebird-support] New context in After trigger
Author Eric
Hallo Martijn,

This code does not work anymore in 2.1. In 1.5 without problems (now
commented, calculating amounts in app.)

Bedankt alvast!



Regards,

Eric



BEGIN

-- SELECT DISTINCT POS.BTWPERCENTAGE FROM POS into :FPBTW;

-- New.BedragExcl = ((New.BedragIncl / (100 + :FPBTW)) * 100);



END;





> In FB 2.1 my "used to work triggers" in 1.5 update a field in the
> table that owns the trigger. For example a field that calculates
amounts
> excl. VAT, VAT etc.
>
> In 2.1 these new.fields are read only. What's the best way to
calculate
> these fields now. Are SP's the best solution for this, these are
> relative simple calculations and for me maintaining the code is easier
> in triggers...

You can still use the NEW.<something> values to calculate, but
the actual update cannot be done via NEW in an After trigger. As
far as I know, this has always been the case.

Can you show us some code that fails now?

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB,
Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com





[Non-text portions of this message have been removed]