Re: Bidimensional Array

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Bidimensional Array
Дата
Msg-id 4EF8DC10.2020103@ejurka.com
обсуждение исходный текст
Ответ на Bidimensional Array  (Leandro Guimarães <leo.guimaraes@gmail.com>)
Список pgsql-jdbc
On 12/26/2011 12:23 PM, Leandro Guimarães wrote:
> Hello Kris,
>    thanks for your answer. The dataType is varchar.
>
>    I did a workaround to solve the problem, but i'm sure it's not a good
> approach.
>
>    I'm using the a1.toString() method and using .split by comma to break
> the value and return the String[]
>

Your problem is that you don't really have a two dimensional array.  You
have a one dimensional array whose contents look similar to an array,
but are actually just a string of text.

jurka=# select array_ndims('{"{319.1,811.2,915.5}"}'::varchar[]);
  array_ndims
-------------
            1


Those interior quotes are not correct.

jurka=# select array_ndims('{{319.1,811.2,915.5}}'::varchar[]);
  array_ndims
-------------
            2

jurka=# select ('{{319.1,811.2,915.5}}'::varchar[])[1][1];
  varchar
---------
  319.1

Kris Jurka



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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Bidimensional Array
Следующее
От: Maciek Sakrejda
Дата:
Сообщение: Re: test git conversion