Re: Inserting using SQL descriptors in ECPG in different versions of Linux

Anders Nilsson <[email protected]> Mon, 2 Oct 2017 09:14:05 -0500
Newsgroups gmane.comp.db.postgresql.interfaces
Message-ID <CAEx11v5rQFjtsR4ZSxnT2uQSD2Z+Hd9SYLK=aD03DDdQWBTSeg@mail.gmail.com>
--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 <[email protected]>
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

<div dir=3D"ltr">Adding the SQL keyword fixed it! And, I was able to remove=
 that dummy insert_desc variable declaration above.<div><br></div><div>Than=
ks for your help,</div><div>Anders</div></div><div class=3D"gmail_extra"><b=
r><div class=3D"gmail_quote">On Sun, Oct 1, 2017 at 3:44 AM, Michael Meskes=
 <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_=
blank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><span class=3D"">&gt; The following code compiles and runs fine w=
ithout error messages on<br>
&gt; the Centos-6 box, but on the Centos-7 box, the execution of the<br>
&gt; prepared query with descriptor returns successful but without<br>
&gt; inserting any records and displaying the &quot;No record actually<br>
&gt; inserted&quot; message. Set PGUSER/PGDATABASE accordingly to run.<br>
<br>
</span>No idea why the same ecpg version behaves differently on these two<b=
r>
boxes. I assume that not both have the same version installed by<br>
default, meaning you installed a non-default PostgreSQL yourself. Maybe<br>
there was something left from the distro provided version?<br>
<span class=3D""><br>
&gt; Any idea what I might be doing wrong?<br>
<br>
</span>Yes.<br>
<span class=3D""><br>
&gt;=C2=A0 =C2=A0 =C2=A0// Insert record<br>
&gt;=C2=A0 =C2=A0 =C2=A0exec sql execute sid1 using descriptor insert_desc;=
<br>
<br>
</span>If my memory serves well, this should be &quot;exec sql<br>
execute sid1 using sql descriptor insert_desc;&quot;<br>
<br>
Without the SQL it tries to insert the sqlda which does not exist.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Michael<br>
--<br>
Michael Meskes<br>
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)<br>
Meskes at (Debian|Postgresql) dot Org<br>
Jabber: michael at xmpp dot meskes dot org<br>
VfL Borussia! For=C3=A7a Bar=C3=A7a! SF 49ers! Use Debian GNU/Linux, Postgr=
eSQL<br>
<br>
</font></span></blockquote></div><br></div>

--94eb2c1cb95cc4bdba055a90fc4e--