La sentencia para cargar una variable con un select es :
Código SQL
[-]
select campo from tabla
where
condición
INTO :VARIABLE
Recuerda que dentro de sentencias SQL, si no le pones : antes del nombre de la variable, FB lo tomará como un campo y te dirá que no existe.
En el resto del Trigger/Procedimiento lo tomará como variables.
Código SQL
[-]
create trigger tabla_bi0 for tabla
active before insert position 0
as
declare variable reqequiv integer;
begin
if (new.aplicar_re = 1) then
select re
from impuestos
where
impuesto_id = new.tipo_iva
into :reqequiv;
else
reqequiv = 0;
insert into regulariz_almcn (
fecha, sentido, causa_id, producto_id, cantidad, precio, iva, re, act_precio, act_stock)
values (
'now', 0, 1, new.producto_id, new.stock_actual, new.precio_compra, (select iva from impuestos where impuesto_id = new.tipo_iva), :reqequiv, 0, 0);
end