public inbox for [email protected]
help / color / mirror / Atom feedRe: Ecpg fetch issue
2+ messages / 2 participants
[nested] [flat]
* Re: Ecpg fetch issue
@ 2025-12-09 20:49 Juan Rodrigo Alejandro Burgos Mella <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Juan Rodrigo Alejandro Burgos Mella @ 2025-12-09 20:49 UTC (permalink / raw)
To: Tzuriel Kahlon <[email protected]>; +Cc: [email protected]
The issue is that there's no direct ECPG for COBOL; ECPG is a C
preprocessor and can only be used as an external function. Alternatively,
you can use libpq as a wrapper, but you'll still need to compile the C code.
Atte
JRBM
El mar, 9 dic 2025 a las 15:30, Tzuriel Kahlon (<[email protected]>)
escribió:
> Hey thank you for the answer , the solution you suggest is modified the
> code in the application side i want to open the ecpg like procob in oracle
> and set it there without any intervention. On the code itself .
>
>
>
>
> *בברכה *
> *צוריאל כחלון *
> 0523851143
>
> On Tue, Dec 9, 2025, 22:27 Juan Rodrigo Alejandro Burgos Mella <
> [email protected]> wrote:
>
>> Hi
>> When using ECPG, if you have a simple FETCH, it will do it row by row;
>> the way to download more than one row at a time is by using data arrays.
>> In my case, when I want to extract, for example, 100 records at once, I
>> use the following model:
>>
>> I define a data array:
>>
>> EXEC SQL BEGIN DECLARE SECTION;
>> struct _resultData {
>> int int_data1;
>> char chr_data2[11];
>> } resultData[100];
>> EXEC SQL END DECLARE SECTION;
>>
>> and then in the fetch:
>>
>> EXEC SQL
>> FETCH FORWARD 100 cCursor
>> INTO :resultData;
>>
>> and the variable sqlca.sqlerrd[2] controls the number of records returned
>>
>> I hope it helps you
>>
>> Atte
>> JRBM
>>
>>
>> El mar, 9 dic 2025 a las 14:53, Tzuriel Kahlon (<[email protected]>)
>> escribió:
>>
>>> Hey all ,
>>> We are using IBM for cobol and connextint postgres db with ecpg the
>>> precompiler , problem is when we running cursor against db the prefetch are
>>> not set correctly and provide one row each time he approach to db and this
>>> decrease the performance significantly if twvle have 100000 rows it take it
>>> one by one each run .
>>> In procob which is the precompiler of Oracle there are option to set the
>>> prefetch to take in each time it approach the db x number of rows you want
>>> and this ease the db retrieved and enhance the performance .
>>> I know that there is a way to change the setting in the application
>>> code, but I want to eliminate touch any code and configure only the ecpg
>>> which is the middle between cobol and db.
>>> There is anyone from you which encountered same issue?
>>>
>>>
>>>
>>>
>>>
>>> *בברכה *
>>> *צוריאל כחלון *
>>> 0523851143
>>>
>>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Ecpg fetch issue
@ 2025-12-09 20:51 Tzuriel Kahlon <[email protected]>
parent: Juan Rodrigo Alejandro Burgos Mella <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Tzuriel Kahlon @ 2025-12-09 20:51 UTC (permalink / raw)
To: Juan Rodrigo Alejandro Burgos Mella <[email protected]>; +Cc: [email protected]
Yes , and this is our issue that we try to solve in our product , we are
working with IBM for cobol and try our luck to see if someone get any
advance on that topic.
*בברכה *
*צוריאל כחלון *
0523851143
On Tue, Dec 9, 2025, 22:49 Juan Rodrigo Alejandro Burgos Mella <
[email protected]> wrote:
> The issue is that there's no direct ECPG for COBOL; ECPG is a C
> preprocessor and can only be used as an external function. Alternatively,
> you can use libpq as a wrapper, but you'll still need to compile the C code.
>
> Atte
> JRBM
>
> El mar, 9 dic 2025 a las 15:30, Tzuriel Kahlon (<[email protected]>)
> escribió:
>
>> Hey thank you for the answer , the solution you suggest is modified the
>> code in the application side i want to open the ecpg like procob in oracle
>> and set it there without any intervention. On the code itself .
>>
>>
>>
>>
>> *בברכה *
>> *צוריאל כחלון *
>> 0523851143
>>
>> On Tue, Dec 9, 2025, 22:27 Juan Rodrigo Alejandro Burgos Mella <
>> [email protected]> wrote:
>>
>>> Hi
>>> When using ECPG, if you have a simple FETCH, it will do it row by row;
>>> the way to download more than one row at a time is by using data arrays.
>>> In my case, when I want to extract, for example, 100 records at once, I
>>> use the following model:
>>>
>>> I define a data array:
>>>
>>> EXEC SQL BEGIN DECLARE SECTION;
>>> struct _resultData {
>>> int int_data1;
>>> char chr_data2[11];
>>> } resultData[100];
>>> EXEC SQL END DECLARE SECTION;
>>>
>>> and then in the fetch:
>>>
>>> EXEC SQL
>>> FETCH FORWARD 100 cCursor
>>> INTO :resultData;
>>>
>>> and the variable sqlca.sqlerrd[2] controls the number of records returned
>>>
>>> I hope it helps you
>>>
>>> Atte
>>> JRBM
>>>
>>>
>>> El mar, 9 dic 2025 a las 14:53, Tzuriel Kahlon (<[email protected]>)
>>> escribió:
>>>
>>>> Hey all ,
>>>> We are using IBM for cobol and connextint postgres db with ecpg the
>>>> precompiler , problem is when we running cursor against db the prefetch are
>>>> not set correctly and provide one row each time he approach to db and this
>>>> decrease the performance significantly if twvle have 100000 rows it take it
>>>> one by one each run .
>>>> In procob which is the precompiler of Oracle there are option to set
>>>> the prefetch to take in each time it approach the db x number of rows you
>>>> want and this ease the db retrieved and enhance the performance .
>>>> I know that there is a way to change the setting in the application
>>>> code, but I want to eliminate touch any code and configure only the ecpg
>>>> which is the middle between cobol and db.
>>>> There is anyone from you which encountered same issue?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *בברכה *
>>>> *צוריאל כחלון *
>>>> 0523851143
>>>>
>>>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-12-09 20:51 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-12-09 20:49 Re: Ecpg fetch issue Juan Rodrigo Alejandro Burgos Mella <[email protected]>
2025-12-09 20:51 ` Tzuriel Kahlon <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox