Subject Re: fetching data in another table in an update procedure
Author dinol.softedge
--- In firebird-support@yahoogroups.com, "Anderson Farias"
<peixedragao@...> wrote:
>
> Hi,
>
> >I am trying to run an update procedure that updates a total in
> >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
>
> just use NEW preceding your trigger-table fields ::
>
> 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
>

Hi

Thanks for your response. I get the following error when running your
code "Subselect illegal in this context".