Re: How to access arrays from DBD::Pg?

Поиск
Список
Период
Сортировка
От will trillich
Тема Re: How to access arrays from DBD::Pg?
Дата
Msg-id 20010602040627.B10951@serensoft.com
обсуждение исходный текст
Ответ на How to access arrays from DBD::Pg?  (elwood@agouros.de (Konstantinos Agouros))
Список pgsql-general
On Sun, May 27, 2001 at 09:39:12PM +0200, Konstantinos Agouros wrote:
> Hi,
>
> I have some data, that I would like to store in array-columns. How can I access
> this from DBD::Pg? Do I have to parse it manually?

that's how i do it. if there's another way i'd love to hear it.

    sub trim { substr(@_[0],1,length(@_[0])-2) };
    my $r = $sth->fetchrow_arrayref();
    # $r->{arraycolumn} resembles {"one","two","three"} --
    my @a = map{ &trim($_) } split /,/, &trim($r->{arraycolumn});
    # presuming no array element contains a comma...!

--
#95: We are waking up and linking to each other. We are watching. But
we are not waiting.  -- www.cluetrain.com

will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

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

Предыдущее
От: Gerald Gutierrez
Дата:
Сообщение: Toggling logging output
Следующее
От: will trillich
Дата:
Сообщение: Re: UPDATE keyword