Subject Re: [firebird-support] change field depending variables
Author Svein Erling Tysvaer
Hmm, changing a field value into a column name isn't trivial. The only
way for it to work, is Martijns suggestion to use EXECUTE STATEMENT.

Set

Arn wrote:
> Hi all
>
> Thanks for the reply.
>
> Here is actually my code:
> -----------------------------------------------------------------------------------
> -- 1 crivo
> select crivo, min_a, max_a, min_b, max_b from cl_crivi where mycode = 1 into
> :crivo_i, :min_a_i, :max_a_i, :min_b_i, :max_b_i;
> -- 2 crivo
> select crivo, min_a, max_a, min_b, max_b from cl_crivi where mycode = 2 into
> :crivo_ii, :min_a_ii, :max_a_ii, :min_b_ii, :max_b_ii;
> -- 3 crivo
> select crivo, min_a, max_a, min_b, max_b from cl_crivi where mycode = 3 into
> :crivo_iii, :min_a_iii, :max_a_iii, :min_b_iii, :max_b_iii;
> -- 4 crivo
> select crivo, min_a, max_a, min_b, max_b from cl_crivi where mycode = 4 into
> :crivo_iv, :min_a_iv, :max_a_iv, :min_b_iv, :max_b_iv;
> --
> select :crivo_i, :crivo_ii, :crivo_iii, :crivo_iv from
> report_tiberina_estesa
> where numero = :n into :q_i, :q_ii, :q_iii, :q_iv;
> ----------------------------------------------------------------------------------------
>
> As You can see this snip do not works:
>
> select :crivo_i, :crivo_ii, :crivo_iii, :crivo_iv from
> report_tiberina_estesa
> where numero = :n into :q_i, :q_ii, :q_iii, :q_iv;
>
> How to set up the above code???
>
> TIA
>
> Arn