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 1vT4Lw-00CDnU-2S for pgsql-general@arkaria.postgresql.org; Tue, 09 Dec 2025 20:30:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vT4Lv-006mrm-14 for pgsql-general@arkaria.postgresql.org; Tue, 09 Dec 2025 20:30:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT4Lu-006mre-36 for pgsql-general@lists.postgresql.org; Tue, 09 Dec 2025 20:30:31 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vT4Lt-0046kS-0Z for pgsql-general@lists.postgresql.org; Tue, 09 Dec 2025 20:30:31 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-c05d66dbab2so998272a12.0 for ; Tue, 09 Dec 2025 12:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765312227; x=1765917027; 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=4Fvn2TFYyoCk3su8hvqqY4xnCZJA8pFH0PdaEBWyhRs=; b=hVGorkIpwO/2f7dUflEIgSc5unRjLtKMldPAKrc+AzZyh/8nft5fV1JL+I3x7Th3YK x4urzBtSA7LPSNxgwMqLqXTfRF1Rim3p4kUvoPtAUzMTUvVN7ldudV5JbhcZD+cNsLVb gxmXF90c892UfNBevLYNgT7ONeCwF1IvSif8bULPCgJZjUFoRVm1EK80JoTsmmIedKIT /3DtVTVlWPjLAI4kVm3siB/kK5vIlSTke5vUK4gEj8mHVPb0oTsuHzATcuv/S3rG63dx xHGHHUmXtmd1OoDQXEgkRDWCv+LYP/srOAoiJK3P/NmkAsQA20jAkVLlAb5283X9646x 9T2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765312227; x=1765917027; 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=4Fvn2TFYyoCk3su8hvqqY4xnCZJA8pFH0PdaEBWyhRs=; b=Bo3qIBbgXsQ89sD68m0UVvGn+rIzoQkIswsmVWC8jbowHGCf43h9+eyraWJbtDYBal a2DCLNL9xe0kx/BIe+bCglk1xcysDrDNeScdo9zfprRm8cSGD+rsymJ8+1kKbHN3k4DU LzQO82/hkRYht8/eTTPABc47L/DLaYlYTSHoNooc9MnXgq4JLyx8nP/IDMzRMZVNwF1e BpNMCjcOMQ6S5alCwZutf3TBe86XQ8paipsnYYSQQ6Y9Qothd6Z4cV53ksrtS9BdTen+ fzPxb8VfR2KYLab9Un9a4zWxPt75NdyHDVfaM648WMsJ57MevyTPVoejrPkQwDqU0km2 o5BA== X-Gm-Message-State: AOJu0YzWns8ppGpwqIO6g5xgUkOlRk9hz8RGCzUvuudSYOFGDhh9+9jQ z/AMlJLXcEtRtWxiz9gdwUw8Vt2ee1csM1CZ0jLHZ08zXmwY2NXdh0Z84uFKCZ8v6nGWQRkbDgx M/gbx/zSrfYpG8MT0KGVJar888/ZNqw== X-Gm-Gg: AY/fxX5rum5jtW0Qy9wHDpw6JBdMhY/b+Q+CMPWSK49kRmUx9TRExJCw6IvwVc8sOWV xbykkK6Y7K0cDm6V8PcL8K2uS1rsMwd1zh3NDArSTjFdU1FT5zeAOCyO56FMQXuEq/K3kclYMQI wkkbX38cjA4lQW7qtsq8ikJQEHVdmjvFp8kBREEscvcUI1/yZfxQCU4m1CmSEu+TUQBg41erdoE Ul74G4V00FxUeOtZTCV+Id8ao/lx3kabH3DHRh8CmtkjVQZm3G0y8qrsykiaOJywaAhXyk1cWzQ gg3QGhCOKKh4FRL2gAhOQcOSQ/8= X-Google-Smtp-Source: AGHT+IFwZTycwSTOuZAeaDABgsHBg5xYfsppNUYPyxd4jRQZhkSX0i9Y8lvfpSe5YxK+d70s/INTzXQcT5b84kP9ym8= X-Received: by 2002:a05:7300:691b:b0:2a9:573a:4a74 with SMTP id 5a478bee46e88-2ac0540a366mr246202eec.9.1765312226575; Tue, 09 Dec 2025 12:30:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Tzuriel Kahlon Date: Tue, 9 Dec 2025 22:30:14 +0200 X-Gm-Features: AQt7F2p5hbN4u9ccuKm5BjDb6uJvOuwawaRvq7QDVPf6LLUxuiwFlEBCO6UkGYs Message-ID: Subject: Re: Ecpg fetch issue To: Juan Rodrigo Alejandro Burgos Mella Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000002ecae306458ac845" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002ecae306458ac845 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 . *=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; th= e > 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 () > 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 prefetch = are >> not set correctly and provide one row each time he approach to db and th= is >> 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 wa= nt >> 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? >> >> >> >> >> >> *=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 >> > --0000000000002ecae306458ac845 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey thank you for the answer , the solution you sugg= est is modified the code in the application side i want to open the ecpg li= ke procob in oracle and set it there without 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 Bu= rgos Mella <rodrigoburgo= smella@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 e= xtract, for example, 100 records at once, I use the following model:
<= div>
I define a data array:

EXEC SQL= BEGIN DECLARE SECTION;
struct _resultData {
int =C2=A0int_data1; char chr_data2[11];
} resultData[100];
EXEC SQL END DECLARE SECTION= ;

and then in the fetch:

EXEC S= QL
FETCH FORWARD 100 cCursor
INTO :resultData;

an= d 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 Kah= lon (<tzuriel1986@gmail.com>) escribi=C3=B3:
Hey all ,<= /div>
We are using IBM for cobol and connextint postgres d= b 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 approac= h to db and this decrease the performance significantly if twvle have 10000= 0 rows it take it one by one each run .
In procob wh= ich is the precompiler of Oracle there are option to set the prefetch to ta= ke in each time it approach the db x number of rows you want and this ease = the db retrieved and enhance the performance .
I kno= w 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 m= iddle between cobol and db.
There is anyone from you= which encountered same issue?





=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
--0000000000002ecae306458ac845--