Re: Stored Procedures

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Stored Procedures
Дата
Msg-id web-1452560@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Stored Procedures  (Wendy Powley <wendy@cs.queensu.ca>)
Список pgsql-novice
Wendy,

> Is it possible to write a stored procedure which takes a struct as a
> parameter?  I'd like to be able to pass in some info via a struct &
> return some info via another struct something like this:

What's a "Struct"?  It's not a standard SQL term, and I don't recognize
it.


> struct in_struct {
>   integer i, j;
> }
>
> struct out_struct {
>   integer k;
>    char p;
> }

Are you trying for a custom data type, or more of a record?  Postgres
supports both.

> create function myfunc(in_struct, out_struct) .....

Postgres does not support output parameters, at present.  Functions
have one return value of a defined data type (which may be a custom
data type or a record, if you wish).

-Josh Berkus



В списке pgsql-novice по дате отправления:

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: Problems with psql : ERROR : pg_user: permission
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Stored Procedures