Subject problem with "for" in procedure
Author ronaldorezende
Why the result of the output variable D is 15 and not 13 ? I'm
needing for values of variables that I set in the "for", but the
values of this variables is don't changed.

begin
E = 15;
FOR
select
DPA.NOTA_PROVA
from DIARIO_PROVA_ALUNO DPA
where
DPA.NOTA_PROVA is not null and
DPA.NUMERO_PROVA = :NUMERO_PROVA
into :NOTA_PROVA
DO BEGIN
X = NOTA_PROVA - MEDIA;
E = 13; <-----The problem is here
END
D = E; <-----Value of output D: 15
suspend;
end