Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dz1U4-0005vL-9N for pgsql-interfaces@arkaria.postgresql.org; Mon, 02 Oct 2017 14:14:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dz1U3-0004HR-Kd for pgsql-interfaces@arkaria.postgresql.org; Mon, 02 Oct 2017 14:14:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dz1U3-0004HI-7p for pgsql-interfaces@postgresql.org; Mon, 02 Oct 2017 14:14:11 +0000 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dz1Tz-0002HZ-UG for pgsql-interfaces@postgresql.org; Mon, 02 Oct 2017 14:14:10 +0000 Received: by mail-lf0-x236.google.com with SMTP id d10so3886004lfg.11 for ; Mon, 02 Oct 2017 07:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa-gov.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YCFn/uBYQCi4rBBBuN+VbcNpEsz8DgDEA5DpWZCjjKg=; b=o1EtPhanWFWS7YBtUwORsPpoU7QfnmvnhBNoLRfM3+wAp/Mv4mwLfkiGnLSIrCF914 mgFpfa+ya9WvaMdCA0wMaqkdLob5w+TEHGp9jQhyCIbpPx79OUg5nobeHw+BlMn7KoEC ggU7ZC4rLiVWgkB68w7EFwNKcTQ0fQFlnfBoSnR8sq2vZzMJaRfZlOrHyrY6XXzYm7Ir 1NUdM3fHjyDAcJnhja59tEyKAQtZelTAttWp2QeH4BTq091v449DLd7RcAQe8Wah1wMX 6cfgjtyonnDhu139YOIMt2AiRa7cLHTaDd/HuUaKBxksGBxIrdLNDLE/n8rtStEyuwXo OKGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YCFn/uBYQCi4rBBBuN+VbcNpEsz8DgDEA5DpWZCjjKg=; b=hjVilHapMFrhIGJunsqRTNw3vCVu+XRu/mOl34zjD2j9xCaKC74AT8Y0PPtGawC52B igpoH902NIrlyFW5aNNQYVvEhKW0VoX2Qt4LtVVV5Mdr+D+FvmzHuApRcfJdm6PBpuKS iTXKckbAS0vNrd697w4G3pqvzC1tvLZZ+jkKYr8lXtAnGcakKyH8xBJ15+kvkRGuns7O +i7s5gCVoDrsnc5aejK9AVqT26Mucrm9YhGcj1WwPV/p0Icf91HQuBm76YX5gHMzlKLG 4GYhknGMh53sShUWwjFp3IsjdRYLE6BNv4f/IZNLpG2qO0Cketw/qjxa6x6In9qDob6Y rsfw== X-Gm-Message-State: AHPjjUhF99b9xbJmi8xs4gPyxViv4AjDfKshjpfUjHIycFDlgjRJqDX+ YAHZJURMwkBkgxmP8BLuMYeu83p7joVPvLlfZY5liA== X-Google-Smtp-Source: AOwi7QC8jrBuBHem4y2uXyFe9Z2Kmrreclrqf6zMUG2jTmM+vQBHCnd8HkcfxDc417z/uZYULb8d6OeyY26IGCVA+3A= X-Received: by 10.25.80.74 with SMTP id z10mr3970420lfj.76.1506953646078; Mon, 02 Oct 2017 07:14:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.2.134 with HTTP; Mon, 2 Oct 2017 07:14:05 -0700 (PDT) In-Reply-To: <1506847463.2588.50.camel@postgresql.org> References: <1506847463.2588.50.camel@postgresql.org> From: Anders Nilsson Date: Mon, 2 Oct 2017 09:14:05 -0500 Message-ID: Subject: Re: Inserting using SQL descriptors in ECPG in different versions of Linux To: Michael Meskes Cc: pgsql-interfaces@postgresql.org Content-Type: multipart/alternative; boundary="94eb2c1cb95cc4bdba055a90fc4e" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-interfaces Precedence: bulk Sender: pgsql-interfaces-owner@postgresql.org --94eb2c1cb95cc4bdba055a90fc4e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Adding the SQL keyword fixed it! And, I was able to remove that dummy insert_desc variable declaration above. Thanks for your help, Anders On Sun, Oct 1, 2017 at 3:44 AM, Michael Meskes wrote: > > The following code compiles and runs fine without error messages on > > the Centos-6 box, but on the Centos-7 box, the execution of the > > prepared query with descriptor returns successful but without > > inserting any records and displaying the "No record actually > > inserted" message. Set PGUSER/PGDATABASE accordingly to run. > > No idea why the same ecpg version behaves differently on these two > boxes. I assume that not both have the same version installed by > default, meaning you installed a non-default PostgreSQL yourself. Maybe > there was something left from the distro provided version? > > > Any idea what I might be doing wrong? > > Yes. > > > // Insert record > > exec sql execute sid1 using descriptor insert_desc; > > If my memory serves well, this should be "exec sql > execute sid1 using sql descriptor insert_desc;" > > Without the SQL it tries to insert the sqlda which does not exist. > > Michael > -- > Michael Meskes > Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) > Meskes at (Debian|Postgresql) dot Org > Jabber: michael at xmpp dot meskes dot org > VfL Borussia! For=C3=A7a Bar=C3=A7a! SF 49ers! Use Debian GNU/Linux, Post= greSQL > > --94eb2c1cb95cc4bdba055a90fc4e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Adding the SQL keyword fixed it! And, I was able to remove= that dummy insert_desc variable declaration above.

Than= ks for your help,
Anders
On Sun, Oct 1, 2017 at 3:44 AM, Michael Meskes= <meskes@postgresql.org> wrote:
> The following code compiles and runs fine w= ithout error messages on
> the Centos-6 box, but on the Centos-7 box, the execution of the
> prepared query with descriptor returns successful but without
> inserting any records and displaying the "No record actually
> inserted" message. Set PGUSER/PGDATABASE accordingly to run.

No idea why the same ecpg version behaves differently on these two boxes. I assume that not both have the same version installed by
default, meaning you installed a non-default PostgreSQL yourself. Maybe
there was something left from the distro provided version?

> Any idea what I might be doing wrong?

Yes.

>=C2=A0 =C2=A0 =C2=A0// Insert record
>=C2=A0 =C2=A0 =C2=A0exec sql execute sid1 using descriptor insert_desc;=

If my memory serves well, this should be "exec sql
execute sid1 using sql descriptor insert_desc;"

Without the SQL it tries to insert the sqlda which does not exist.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! For=C3=A7a Bar=C3=A7a! SF 49ers! Use Debian GNU/Linux, Postgr= eSQL


--94eb2c1cb95cc4bdba055a90fc4e--