Subject | Re: [firebird-support] fetching data in another table in an update procedure |
---|---|
Author | Anderson Farias |
Post date | 2008-06-09T16:20:04Z |
Hi,
CREATE TRIGGER ITEM_TOTAL_EXCL FOR TBL_JOB_CARD_INVENTORY
ACTIVE BEFORE INSERT OR UPDATE POSITION 1
AS
BEGIN
NEW.Total_Incl = (NEW.Selling_Price -
NEW.Selling_Price*NEW.Item_Discount/100)*NEW.Quantity*(select tax_percentage
from tbl_settings);
END;
Regards,
Anderson Farias
>I am trying to run an update procedure that updates a total injust use NEW preceding your trigger-table fields ::
>tbl_job_card_inventory by multiplying values in the field
>tax_percentage from the tbl_settings table. I receive an error and am
>unable to figure out how to get aroung this type of query
CREATE TRIGGER ITEM_TOTAL_EXCL FOR TBL_JOB_CARD_INVENTORY
ACTIVE BEFORE INSERT OR UPDATE POSITION 1
AS
BEGIN
NEW.Total_Incl = (NEW.Selling_Price -
NEW.Selling_Price*NEW.Item_Discount/100)*NEW.Quantity*(select tax_percentage
from tbl_settings);
END;
Regards,
Anderson Farias