Re: tough one

Поиск
Список
Период
Сортировка
От John Anderson
Тема Re: tough one
Дата
Msg-id 4.2.0.58.20010810195504.00a893e0@frank
обсуждение исходный текст
Ответ на tough one  (Tony Grant <tony@animaproductions.com>)
Список pgsql-jdbc
At 16:51 2001/08/09 +0200, Tony Grant wrote:
>festival        | filmid
>------------------------------------------
>1979            | 102, 103, 104
>1980            | 258, 369, 489, 568
>
>How can I simulate an ARRAY of this type? If I can't - where is the
>nearest bridge?

you could define a table with this data:

festival        | filmid
------------------------------------------
1979            | 102
1979            | 103
1979            | 104
1980            | 258
1980            | 369
1980            | 489
1980            | 568

with a query like this:

select filmid from films where festival = '1980'

and use a loop like this to generate an array

Vector films = new Vector();
while ( rs.next() )
{
         films.add ( rs.getString ( "filmid" ) );
}

bye
John


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

Предыдущее
От: Gunnar Rønning
Дата:
Сообщение: Re: Which JDK to build jdbc1 driver on Linux?
Следующее
От: Bryan Field-Elliot
Дата:
Сообщение: How to read PG Circle and Point types from JDBC?