Subject Re: [ib-support] error in procedure
Author Daniel Rail
Hi,

At April 22, 2003, 15:44, ronaldorezende wrote:

> My procedure are doesnt execute right.

> In this check, the code is not jumping to the else command.
> if (QTD_ALUNO_DIARIO > 0) then

> Is there a way to debug this code?

> my code:
--------
create procedure INSERIR_ALUNOS_EM_DIARIO (
ID_CURSO integer,
ID_DISCIPLINA smallint,
ID_FASE smallint,
ID_TURMA varchar(10) character set WIN1252)
returns (
QTD_ALUNO smallint)
as
DECLARE VARIABLE ID_ALUNO INTEGER;
DECLARE VARIABLE NUMERO_CHAMADA SMALLINT;
DECLARE VARIABLE QTD_ALUNO_DIARIO SMALLINT;
begin
QTD_ALUNO = 0;
NUMERO_CHAMADA = 0;
select
count(*)
from DIARIO_ALUNO
where ID_CURSO = :ID_CURSO and
ID_DISCIPLINA = :ID_DISCIPLINA and
ID_FASE = :ID_FASE and
ID_TURMA = :ID_TURMA
into QTD_ALUNO_DIARIO;

--> Don't forget the colon before QTD_ALUNO_DIARIO:
into :QTD_ALUNO_DIARIO;


--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)