Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT4gw-00CLf3-1f for pgsql-general@arkaria.postgresql.org; Tue, 09 Dec 2025 20:52:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vT4gv-006x9E-0X for pgsql-general@arkaria.postgresql.org; Tue, 09 Dec 2025 20:52:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT4gu-006x96-2E for pgsql-general@lists.postgresql.org; Tue, 09 Dec 2025 20:52:13 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vT4gt-003zg7-0J for pgsql-general@lists.postgresql.org; Tue, 09 Dec 2025 20:52:12 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-c026e074373so2089623a12.1 for ; Tue, 09 Dec 2025 12:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765313530; x=1765918330; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ay9BFEm0xgaF2sdKNcb7+BfcJ1koyImb6TupPWy0S60=; b=LhR1oOAXNc9Ow5BWWLQ393cr3DtugvZcK8anudme9l97d5tSxa3iourBlOAyp8FjSn bWTsJWk16TPOXv0SdFobq1eCy4ltG41xCQh3Mjpb02kUcdTJklyht5PkyRI7AknpVE0V 1rP6GwgT2uZq74R/63eE1AytXkx8S8ymCxgSg5JbQExPxRxxyUlMCETzm5Bru4235Wi6 JrktXchku66Y0a+UDpRo57xPYJiwzy+KmWNiOO53CW224LRjZG+1+b0VM41PpwnwScwQ 2yA3fo6lOKIwsm7sK672Co0nP0p2WYbfE3mBxNTPyMUqCTL7GixvwTF4P+hwCJ3onkCb AC8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765313530; x=1765918330; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ay9BFEm0xgaF2sdKNcb7+BfcJ1koyImb6TupPWy0S60=; b=fjys+oiuqkOq0DdAeR2iZrsvjISgFCV+fcMzCjY3y/XK9Q3WPoWSj4HlLwmKMNxl4K D6QKmGUHxrIZYvAyiz6d9UVVvzoCcMhE4tEpwOY1Lw5KOocbBgv4pFVI6rMJvo1Uce7p 0htWbmAeTr+gBDeZOg7OyboZ3BAIstw3pwDF9xvke0FIPoQqxY+mj/0T1ehtTMJT1Ok7 DkzZ54WA1m8LnWyq4KBk+3c4LLmQrgx7jY9EgX+sJlDYjsA3FQDLDX2i1jAEMRSyf4Jw 2PN2V177oj5OaxclySWaMjQ0K4O4vesN3qhbZtu169AYHDSOVVTXPz09Nic6NU+RHzxc IQoQ== X-Gm-Message-State: AOJu0YxCxl8cBHrEn4eCPmEPYjhFDukLIoYXolgBa6tqq5UetoMsWzLK eanZXF6FI/SFuypnxatiOtFQBgPeoXoukgMVi80AjEQtaaER7qBm4ovFvgD5Hl4qMjaYe68AW/z 4dqIc0JZ1ioTX1ZI+RLXAZc8TmXV+XQ== X-Gm-Gg: AY/fxX5rhY37gdjn6sRDYY0uQFa9hRRFA+1KPj4igJcNsF979yoTW4lWHVFRMbuh7er 3ySzlaELpMT+YckPLe+GpldUFAEIMbOM91liKr+ABamdxi6EPuTaPHgCcZpM0Caqd1zlfXzutI7 lO9DTlUfGgZhjvDvxBqvrX72kZVn+fVpcyjwwFEQfCGjO+uaj2+mMlcPL9F5fuk22NuKdFs8yrl XeUE4kNUYouvO7aJGZdE9f7fzyz2hvSKrL9XtBfbGlbAgPjkFOInbh63fvqtsntICXsNlHU2qqW FUYYYpIFF/fjRHUvs/t7DkE2TGM= X-Google-Smtp-Source: AGHT+IHgssqBk6tO7n9zOBxg9VmEamBxDlAkNZCp27ZISRYS2e+q+YZ81T+9mZeNddkHP/+k/erUzdi78Cvt3ui4SrI= X-Received: by 2002:a05:693c:608a:b0:2ab:f56e:bea6 with SMTP id 5a478bee46e88-2ac055a0933mr273363eec.39.1765313529903; Tue, 09 Dec 2025 12:52:09 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Tzuriel Kahlon Date: Tue, 9 Dec 2025 22:51:58 +0200 X-Gm-Features: AQt7F2o_uAk4Gdj1AllXbrBSbxWHv7fv2RT80l7RMYhS_m1QUqb4J-wvkX4Za1o Message-ID: Subject: Re: Ecpg fetch issue To: Juan Rodrigo Alejandro Burgos Mella Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000de07b906458b1545" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000de07b906458b1545 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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. *=D7=91=D7=91=D7=A8=D7=9B=D7=94 * *=D7=A6=D7=95=D7=A8=D7=99=D7=90=D7=9C =D7=9B=D7=97=D7=9C=D7=95=D7=9F * 0523851143 On Tue, Dec 9, 2025, 22:49 Juan Rodrigo Alejandro Burgos Mella < rodrigoburgosmella@gmail.com> 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 co= de. > > Atte > JRBM > > El mar, 9 dic 2025 a las 15:30, Tzuriel Kahlon () > escribi=C3=B3: > >> 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 orac= le >> and set it there without any intervention. On the code itself . >> >> >> >> >> *=D7=91=D7=91=D7=A8=D7=9B=D7=94 * >> *=D7=A6=D7=95=D7=A8=D7=99=D7=90=D7=9C =D7=9B=D7=97=D7=9C=D7=95=D7=9F * >> 0523851143 >> >> On Tue, Dec 9, 2025, 22:27 Juan Rodrigo Alejandro Burgos Mella < >> rodrigoburgosmella@gmail.com> 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 return= ed >>> >>> I hope it helps you >>> >>> Atte >>> JRBM >>> >>> >>> El mar, 9 dic 2025 a las 14:53, Tzuriel Kahlon (= ) >>> escribi=C3=B3: >>> >>>> 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 prefetc= h 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 ta= ke 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 ec= pg >>>> which is the middle between cobol and db. >>>> There is anyone from you which encountered same issue? >>>> >>>> >>>> >>>> >>>> >>>> *=D7=91=D7=91=D7=A8=D7=9B=D7=94 * >>>> *=D7=A6=D7=95=D7=A8=D7=99=D7=90=D7=9C =D7=9B=D7=97=D7=9C=D7=95=D7=9F * >>>> 0523851143 >>>> >>> --000000000000de07b906458b1545 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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.=C2=A0




=
=D7=91=D7=91=D7=A8=D7=9B=D7=94=C2=A0
=D7=A6= =D7=95=D7=A8=D7=99=D7=90=D7=9C =D7=9B=D7=97=D7=9C=D7=95=D7=9F=C2=A0
0523851143

On Tue, Dec 9, 202= 5, 22:49 Juan Rodrigo Alejandro Burgos Mella <rodrigoburgosmella@gmail.com> wrote:
=
The issue is that ther= e'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 (&= lt;tzuriel1986@gmail.com>) escribi=C3=B3:
Hey thank you fo= r the answer , the solution you suggest is modified the code in the applica= tion side i want to open the ecpg like procob in oracle and set it there wi= thout any intervention. On the code itself .




=D7=91=D7=91=D7=A8=D7= =9B=D7=94=C2=A0
=D7=A6=D7=95=D7=A8=D7=99=D7=90=D7=9C =D7= =9B=D7=97=D7=9C=D7=95=D7=9F=C2=A0
0523851143

On Tue, Dec 9, 2025, 22:27 Juan Rodrigo Alejandro Burgos Mella <rodrigoburgosmella@gmail.com> wrote:
Hi
When us= ing 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 onc= e, I use the following model:

I define a data arra= y:

EXEC SQL BEGIN DECLARE SECTION;
struct _resu= ltData {
int =C2=A0int_data1;
char chr_data2[11];
} resultData[1= 00];
EXEC SQL END DECLARE SECTION;

and then in the fet= ch:

EXEC SQL
FETCH FORWARD 100 cCursor
IN= TO :resultData;

and the variable sqlca.sqlerrd[2] control= s the number of records returned

I hope it helps y= ou

Atte
JRBM

<= br>
El mar,= 9 dic 2025 a las 14:53, Tzuriel Kahlon (<tzuriel1986@gmai= l.com>) escribi=C3=B3:
Hey all ,
We ar= e 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 cor= rectly and provide one row each time he approach to db and this decrease th= e performance significantly if twvle have 100000 rows it take it one by one= each run .
In procob which is the precompiler of Or= acle 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 cha= nge 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.<= /div>
There is anyone from you which encountered same issu= e?




=D7=91=D7=91=D7=A8=D7=9B=D7=94=C2= =A0
=D7=A6=D7=95=D7=A8=D7=99=D7=90=D7=9C =D7=9B=D7=97=D7= =9C=D7=95=D7=9F=C2=A0
0523851143
--000000000000de07b906458b1545--