Re: How to create stored procedure in PostgreSQL?
| От | Brandon Craig Rhodes |
|---|---|
| Тема | Re: How to create stored procedure in PostgreSQL? |
| Дата | |
| Msg-id | w6fzqs6u22.fsf@guinness.ts.gatech.edu обсуждение исходный текст |
| Ответ на | How to create stored procedure in PostgreSQL? (Yolanda Valverde <yvalverde@chiusac.com>) |
| Список | pgsql-general |
Yolanda Valverde <yvalverde@chiusac.com> writes:
> Me gustaría saber como crear procedimientos almacenados en PostgreSQL, yo
> he trabajado con funciones, pero el problema que tengo es que la funcion
> retorna un solo valor; lo que a mi me interesa saber es como retornar
> varios valores.
create table two_integers (integer1 int, integer2 int);
create function square_and_cube(int) RETURNS setof two_integers
AS 'select $1*$1, $1*$1*$1;' LANGUAGE SQL;
SELECT * FROM square_and_cube(3);
-->
integer1 | integer2
----------+----------
9 | 27
http://www3.us.postgresql.org/users-lounge/docs/7.3/postgres/xfunc-tablefunctions.html
--
Brandon Craig Rhodes http://www.rhodesmill.org/brandon
Georgia Tech brandon@oit.gatech.edu
В списке pgsql-general по дате отправления: