Skip site navigation (1) Skip section navigation (2)

Return record on recursive call

From: "Alexander B(dot)" <burbello3000(at)yahoo(dot)com(dot)br>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Return record on recursive call
Date: 2007-05-28 20:06:55
Message-ID: 465B365F.2010605@yahoo.com.br (view raw or flat)
Thread:
Lists: pgsql-admin
Hi,

I am creating a function that when finished the last level, should
return for each row.
I put raise notice to trace and the result is correct, but when I try to
execute, an error is showed.

"ERRO: wrong record type supplied in RETURN NEXT"

I created other functions the same way and worked, basically using the
same structure but not recursive.
Is it different return when using recursive.

sample code:
"...
            loop
                raise notice ''  cur1 -> CodCooperativa=% - TipoCoo=%'',
cur1.coo_cod_cooperativa, pTipoCoo;

                cur_result.cod_cooperativa      = cur1.coo_cod_cooperativa;
                cur_result.cooperativa_superior =
cur1.coo_cooperativa_superior;
                cur_result.nro_documento        = cur1.coo_nro_documento;
                cur_result.tipo                 = cur1.reg_cod_registro;
                cur_result.nome_fantasia        = cur1.coo_nome_fantasia;

                return next cur_result;
..."

Thanks in advance.


Responses

pgsql-admin by date

Next:From: Michael FuhrDate: 2007-05-28 21:40:08
Subject: Re: Return record on recursive call
Previous:From: Tom LaneDate: 2007-05-28 15:18:37
Subject: Re: ERROR: invalid memory alloc request size

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group