ECPG mass retrieval? - Mailing list pgsql-interfaces

From Stergios Zissakis
Subject ECPG mass retrieval?
Date
Msg-id NGBBJHBHDKPNOODGDMMAKELNCGAA.szis@intranet.gr
Whole thread Raw
Responses Re: ECPG mass retrieval?  (Edmund Bacon <ebacon@onesystem.com>)
Re: ECPG mass retrieval?  (Michael Meskes <meskes@postgresql.org>)
List 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 by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Portable interfaces ...
Next
From: Edmund Bacon
Date:
Subject: Re: ECPG mass retrieval?