I am trying to update table A with data from table B. I thought I can do something like this
update A
set A.DISCOUNT = 3
from INVOICE_ITEMS A
join ITEM_PRI
From FB manual, if you are using Firebird 2.0 or above, you can use EXECUTE BLOCK to write a more effective statement:
EXECUTE BLOCK
AS
DECLARE VARIABLE field1 type;
DECLARE VARIABLE field2 type;
-- ...etc.
DECLARE VARIABLE pk type;
BEGIN
for select pk, field1, field2, ... from src_table
into :pk, :field1, :field2, ...
do update dest_table set field1 = :field1, field2 = :field2, -- ...
where pk = :pk;
END