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

RE: Return Query

From: Edwin Quijada <listas_quijada(at)hotmail(dot)com>
To: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: RE: Return Query
Date: 2008-06-29 23:19:15
Message-ID: BLU137-W3007FB763DEB0328DED006E39C0@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-es-ayuda





> Date: Sun, 29 Jun 2008 00:29:57 -0500
> From: jcasanov(at)systemguards(dot)com(dot)ec
> To: listas_quijada(at)hotmail(dot)com
> Subject: Re: [pgsql-es-ayuda] Return Query
> CC: pgsql-es-ayuda(at)postgresql(dot)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

In response to

Responses

pgsql-es-ayuda by date

Next:From: Reynier Perez MiraDate: 2008-06-29 23:20:02
Subject: RE: [OT] Cubanos en la lista
Previous:From: Gabriel Hermes Colina ZambraDate: 2008-06-29 23:08:06
Subject: Re: [OT] Cubanos en la lista

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