zac
zac

Reputation: 4918

Firebird unknown token 'into' when using EXECUTE STATEMENT

I use EXECUTE STATEMENT to return values from select like this:

 EXECUTE STATEMENT 'select '||:fl||','||:f2||','||:f3||
      ' from tab1 where tab1_ID = '||:f_id
      into :v_f1,:v_f2,:v_f3;

When I try to execute I get unknown token 'into' why is that and how to solve it?

Upvotes: 0

Views: 967

Answers (1)

binar
binar

Reputation: 1197

I believe you are trying to use this in a procedure/trigger in Firebird 1.5, but it's just guessing. A little more detail would help.

Why use "execute statement" and not use PLSQL directly, like:

begin
select fl, f2, f3 from tab1 where tab1_ID = :f_id into :v_f1,:v_f2,:v_f3;
end

assuming you previously declare f_id, v_f1, v_f2, v_f3 as variables or parameters.

Upvotes: 0

Related Questions