Subject Re: problem with "for" in procedure
Author ronaldorezende
My original code is this below.
The result of the query of ther "for" give me 37 records.
The result of the output variable Y is 4. The right result for this
variable is not for.

begin
SOMA = 0.0;
Y = 4;
FOR
select
DPA.NOTA_PROVA
from DIARIO_PROVA_ALUNO DPA
where
DPA.NOTA_PROVA is not null and
DPA.ID_CURSO = :CURSO and
DPA.ID_DISCIPLINA = :DISCIPLINA and
DPA.ID_FASE = :FASE and
DPA.ID_TURMA = :TURMA and
DPA.NUMERO_PROVA = :NUMERO_PROVA
into :NOTA_PROVA
DO BEGIN
Y = Y+1;
X = NOTA_PROVA - MEDIA;
POTENCIA = POWER(X,2);
SOMA = SOMA + POTENCIA;
END
SOMA = SOMA / qtd_aluno;
DPM = SQRT(SOMA);
suspend;
end