From: Mark Kirkwood <markir@paradise.net.nz>
To: pgsql-interfaces@postgresql.org
Subject: Ecpg : caught by global sqlca
Date: Thu, 30 Jan 2003 21:59:14 +1300
Message-ID: <3E38E962.7060504@paradise.net.nz> (raw)
Dear list,
I have been porting a few embedded sql programs from DB2 to Postgres.
While overall its a pretty painless exercise, I did get caught by the
global sqlca thing.
The piece of code went something like :
EXEC SQL INCLUDE sqlca;
main() {
..
struct sqlca sqlca;
..
(more code)
}
Now I found that any tests on sqlca.sqlcode within main() produced
meaningless results.
Eventually light dawned that sqlca looked like it was uninitialized, and
that I need to have something like :
EXEC SQL INCLUDE sqlca;
struct sqlca sqlca;
main()
..
This strikes me as something that would be good to mention in the Ecpg
doco - in bold type for people like me....:-)
regards
Mark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: markir@paradise.net.nz
Subject: Re: Ecpg : caught by global sqlca
In-Reply-To: <3E38E962.7060504@paradise.net.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox