ECPG mass retrieval?

Поиск
Список
Период
Сортировка
От Stergios Zissakis
Тема ECPG mass retrieval?
Дата
Msg-id NGBBJHBHDKPNOODGDMMAKELNCGAA.szis@intranet.gr
обсуждение исходный текст
Ответы Re: ECPG mass retrieval?  (Edmund Bacon <ebacon@onesystem.com>)
Re: ECPG mass retrieval?  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-interfaces
Hi there,

It is possible to do bulk retrievals using ECPG?

What I mean is that I want to be able to delcare a host array variable, of
size 100 for example, and get
to retrive my data in batches of 100 rows.

To be more specific the following piece of code, using a cursor, results in
the databse being accessed at every fetch statement degrading performance:
    sprintf(stmt, "select * from test where number between %d and %d and
string = \'%s\'", lower, upper, context);
    EXEC SQL PREPARE S FROM :stmt;    EXEC SQL AT :ctx DECLARE curs CURSOR FOR S;    EXEC SQL AT :ctx OPEN curs;
    EXEC SQL WHENEVER NOT FOUND DO break;
    while( true )    {        EXEC SQL AT :ctx FETCH NEXT FROM curs INTO :num, :str;    }


What alternatives do I have to fetch things in bulk?

Thanks for your help.

Regards,

Stergios Zissakis



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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Portable interfaces ...
Следующее
От: Edmund Bacon
Дата:
Сообщение: Re: ECPG mass retrieval?