Please give me an example how to reference field names with variable in a Firebird stored procedure or execute block
Something like this pseudo SQL:
Insert into tab1 (1, f1, f2, f3)
select 1, tab2.f+var_loop, tab2.f+var_loop, tab2.f+var_loop
from tab2
where .....
where “f” is the first initial of the field name and “var_loop” is a loop variable
It’s still not quite clear to me what you want to achieve, but in the PSQL there is also EXECUTE STATEMENT feature available which might suit your needs – it allows you to buid a string and then execute it as a DSQL statement… Assuming the
var_loopin your example is integer your code might be something like