>>Here you change the SQL for each iteration, hence I cannot see how it would
>>be possible to prepare only once. What you could try, is to use a temporary
>>table, change your statement to:
Simple if after "iteration" query look like
SELECT * FROM TABLE WHERE ID=?
SELECT * FROM TABLE WHERE
>3. when i change proc to use execute statement with parameters
>
>SET TERM ^ ;
>CREATE PROCEDURE MY_PROC_CALC_EXEC_PARAM(ID INTEGER) RETURNS(SUM_AAA INTEGER)
>AS
>DECLARE VARIABLE VAR_SQL VARCHAR(1000);
>BEGIN
> VAR_SQL = 'SELECT SUM(AAA) FROM TABLEY WHERE ID=:ID';
> EXECUTE STATEMENT (VAR_SQL)