Re: parametros de salida en procedimiento

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "Carlos Alberto Cianci" <cacianci(at)yahoo(dot)com(dot)ar>
Cc: "Alejandro D(dot) Burne" <alejandro(dot)dburne(at)gmail(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: parametros de salida en procedimiento
Date: 2006-05-24 00:34:35
Message-ID: c2d9e70e0605231734w2ac2d9ael2d54751d9614ac71@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On 5/23/06, Carlos Alberto Cianci <cacianci(at)yahoo(dot)com(dot)ar> wrote:
>
> Alejandro:
> Muchas gracias. Te hago otra pregunta. Se puede crear un procedimiento que
> te devuelva un conjunto de registros?
>
> Carlos Cianci
> Argentina
>

http://www.postgresql.org/docs/8.1/static/xfunc-sql.html

32.4.5. SQL Functions Returning Sets
CREATE FUNCTION getfoo(int) RETURNS SETOF foo AS $$
SELECT * FROM foo WHERE fooid = $1;
$$ LANGUAGE SQL;

http://www.postgresql.org/docs/8.1/static/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING

y en pl/pgsql necesitas usar RETURN NEXT

en los archivos hay varios ejemplos que te pueden servir...

--
Atentamente,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Jaime Casanova 2006-05-24 03:36:20 Nuevos releases, actualizacion de seguridad
Previous Message Julio Rivero 2006-05-23 22:42:35 Re: Error al llamar procedimiento con distintas variables de entrada