Sunday, June 29, 2008

RE: [pgsql-es-ayuda] Return Query

> Date: Sun, 29 Jun 2008 00:29:57 -0500
> From: jcasanov@systemguards.com.ec
> To: listas_quijada@hotmail.com
> Subject: Re: [pgsql-es-ayuda] Return Query
> CC: pgsql-es-ayuda@postgresql.org
>
> On Sat, Jun 28, 2008 at 12:26 PM, Edwin Quijada
> wrote:
>>>>
>>>> Consigo el sigte error:
>>>> ERROR: a column definition list is required for functions returning "record"
>>>>
>>>
>>> create or replace function f1(out id_record integer, out alias text)
>>> returns setof record as
>>> $$
>>> begin
>>> return query select id_record,alias from uno_email_alias;
>>> end;
>>> $$ language plpgsql;
>>>
>> Jaime, como la invoco?
>
> select * from f1();

Consigo este error cuando lo hago asi

ERROR: structure of query does not match function result type
CONTEXT: PL/pgSQL function "f1" line 2 at RETURN QUERY

*-------------------------------------------------------*
*-Edwin Quijada
*-Developer DataBase
*-JQ Microsistemas
*-809-849-8087

* " Si deseas lograr cosas excepcionales debes de hacer cosas fuera de lo comun"
*-------------------------------------------------------*

>
> --
> Atentamente,
> Jaime Casanova
> Soporte y capacitación de PostgreSQL
> Guayaquil - Ecuador
> Cel. (593) 87171157
> --
> TIP 10: no uses HTML en tu pregunta, seguro que quien responda no podrá leerlo

_________________________________________________________________
Send funny voice messages packed with tidbits from MSN. Everyone wants to be ready.
http://www.noonewantstolookdumb.com?OCID=T001MSN54N1613A--
TIP 7: no olvides aumentar la configuración del "free space map"

No comments: