Re: [GENERAL] How to loop through multi-dimentional array in PL/PGSQL

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: [GENERAL] How to loop through multi-dimentional array in PL/PGSQL
Дата
Msg-id d10b22de-92f4-2828-d8e2-08d16f79abe6@iol.ie
обсуждение исходный текст
Ответ на [GENERAL] How to loop through multi-dimentional array in PL/PGSQL  (VENKTESH GUTTEDAR <venkteshguttedar@gmail.com>)
Ответы Re: [GENERAL] How to loop through multi-dimentional array in PL/PGSQL  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general
On 09/12/16 06:35, VENKTESH GUTTEDAR wrote:
> Hello,
>
>     Please help me in accessing multi-dimentional array in postgresql
> PL/PGSQL.
>
>     for i in array_lower(product_list, 1) .. array_upper(product_list, 1)
>     LOOP
>         product_list[i][0];
>     END LOOP;
>
>     Is the above code right?
>
>     Or is there any other way to access, i am getting null for
> product_list[i][0];

By default, PostgreSQL uses 1-based arrays (i.e. no [0] slot), so maybe
that's your problem.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


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

Предыдущее
От: Shreeyansh Dba
Дата:
Сообщение: [GENERAL] Re: [ADMIN] Would like to below scenario is possible for gettingpage/block corruption
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: [GENERAL] How to loop through multi-dimentional array in PL/PGSQL