Ecpg : caught by global sqlca

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Ecpg : caught by global sqlca
Date: 2003-01-30 08:59:14
Message-ID: 3E38E962.7060504@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Meskes 2003-01-30 09:45:03 Re: Ecpg : caught by global sqlca
Previous Message ljb 2003-01-30 02:09:00 Any interest in a Tcl-only libpgtcl project?