Subject RE: [firebird-support] What is happend ?
Author Thomas Steinmaurer
> So, I have this stored procedure, but only one record I see when her
> finish.... Do you know what is happend ?
>
> Perhaps the terminator character ";" semicolon, I read about change him
> (set term ^ ; ..... End ^ set term : ^) but I try to using in
> IBManager console, IBConsole and IBEasy console, but unsucessful.
>
> Tks for help
>
> Gerson
>
> See the Stored Procedure:
> ------------------------------------------------------------------------
> ---------start
> CREATE PROCEDURE SP_TB_DGA_POS_BAS_02
> RETURNS (
> COD_DGA_POS INTEGER,
> COD_DGA INTEGER,
> DESC_TOTAL VARCHAR (30),
> QTDE_REFIL INTEGER,
> POSOLOGIA VARCHAR (1000),
> RETURN_CODE_O INTEGER)
> AS
> declare variable qtde_total1 numeric(12,3);
> declare variable desc_total1 varchar(20);
> declare variable qtde_total2 integer;
> begin
> for
> select cod_dga_pos
> ,cod_dga
> ,t1.qtde_total
> ,t2.descricao
> ,t1.qtde_refil
> ,t1.posologia
> from tb_dga_pos_bas t1
> left join tb_dga_tpo2 t2 on
> t1.cod_dga_tpo2_total=t2.cod_dga_tpo2
> into :cod_dga_pos
> ,:cod_dga
> ,:qtde_total1
> ,:desc_total1
> ,:qtde_refil
> ,:posologia
> do
> begin
> qtde_total2 = qtde_total1;
> DESC_TOTAL = qtde_total2 || ' ' || desc_total1;
> end
> suspend;
> End

Put the SUSPEND statement inside the begin/end block.


...
do
begin
qtde_total2 = qtde_total1;
DESC_TOTAL = qtde_total2 || ' ' || desc_total1;
suspend;
end



Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com