Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 49367475B33 for ; Thu, 30 Jan 2003 04:00:52 -0500 (EST) Received: from smtp-1.paradise.net.nz (smtp-1a.paradise.net.nz [202.0.32.194]) by postgresql.org (Postfix) with ESMTP id 6AC5F475AAC for ; Thu, 30 Jan 2003 04:00:51 -0500 (EST) Received: from paradise.net.nz (203-79-123-101.adsl.paradise.net.nz [203.79.123.101]) by smtp-1.paradise.net.nz (Postfix) with ESMTP id 2714E82BDB for ; Thu, 30 Jan 2003 22:00:51 +1300 (NZDT) Message-ID: <3E38E962.7060504@paradise.net.nz> Date: Thu, 30 Jan 2003 21:59:14 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Ecpg : caught by global sqlca Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/119 X-Sequence-Number: 3619 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