Re: pgsql variables from records

Поиск
Список
Период
Сортировка
От SunWuKung
Тема Re: pgsql variables from records
Дата
Msg-id MPG.1e8504233523475a98968f@news.postgresql.org
обсуждение исходный текст
Ответ на pgsql variables from records  (SunWuKung <Balazs.Klein@axelero.hu>)
Ответы Re: pgsql variables from records  (Kenneth Downs <ken@secdat.com>)
Список pgsql-general
In article <441AD636.6090009@archonet.com>, dev@archonet.com says...
> SunWuKung wrote:
> > Select Into max_option parameter_value From parameters Where methodid=
> > 999 And parameter_name='max_option'
> >
> > and so on for each parameter.
> >
> > Is there a way to get all these parameters into one variable in pgsql -
> > eg. Select Into paramarray(param_name, param_value) parameter_name,
> > parameter_value Where methodid=999 - and refer to their values in a
> > simple way like param_array.max_option ?
>
> Have a look at using a variable of type RECORD. See the plpgsql
> documentation for examples.
>
>
This sounds very promising, but I have looked at the RECORD variable
type, and found no example that would show how I could use it the way I
described.
In order to get the value of rec.max_option I would first need to
dynamically create a record variable in which all the param_name values
of the original recordset are columns and contain the corresponding
param_value. I found no example how to do this - could you direct me to
one?

Thanks.
Balázs

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: each line counter
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: can't create user collumn