Received: from pille.addcom.de (qmailr@h-62.96.128.34.host.de.colt.net [62.96.128.34]) by hub.org (8.9.3/8.9.3) with SMTP id CAA95012 for ; Mon, 13 Dec 1999 02:09:39 -0500 (EST) (envelope-from michael@fam-meskes.de) Received: (qmail 15442 invoked from network); 13 Dec 1999 07:09:33 -0000 Received: from h-62.96.148.164.host.de.colt.net (root@62.96.148.164) by pille.addcom.de with SMTP; 13 Dec 1999 07:09:33 -0000 Received: (from michael@localhost) by tanja.fam-meskes.de (8.9.3/8.9.3/Debian 8.9.3-6) id PAA00776; Sun, 12 Dec 1999 15:18:57 +0100 Date: Sun, 12 Dec 1999 15:18:57 +0100 From: Michael Meskes To: Martin Jackson Cc: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] ESQL/C Docs: Request for code Message-ID: <19991212151857.A548@fam-meskes.de> Mail-Followup-To: Martin Jackson , pgsql-interfaces@postgresql.org References: <3852B326.D68C6BE2@nwa.quik.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <3852B326.D68C6BE2@nwa.quik.com>; from mhjacks@nwa.quik.com on Sat, Dec 11, 1999 at 02:25:10PM -0600 On Sat, Dec 11, 1999 at 02:25:10PM -0600, Martin Jackson wrote: > I am looking for examples of working ECPG code. Partly I would like to There are some in the source code under test/. > see for myself how it works, but I would also be willing to write some > documentation on it, which I would be willing to submit to the CVS tree. Great. :-) > I do not understand, for example, how to handle cursors in ECPG because > I have not found any examples of doing so in the documentation I have. > Others have probably had the same problem. Cursors are used in the test examples. > I am familiar with the Informix ESQL/C implementation, if that matters. It should be the same for the most part. I'm interested in hearing about all differences you find. > 1) How do you set up a fetch operation? Is there a nicer way to do it > in EC without a cursor? That is, > > DECLARE foo CURSOR FOR > SELECT * FROM bar > WHERE baz = :bazval > > {time passes} > > FETCH foo INTO :bletch, :foo2; SELECT * INTO :bletch, :Bazval FROM bar where baz = :bazval > 2) Can you PREPARE (i.e. cache) statements for later execution? > EXEC SQL DELETE FROM foo > WHERE baz = ? Yes. > 3) Does Postgres directly support placeholders (?)? I've used them in > DBI, but I don't know whether that's some hack by the Postgres driver > author or if it's an actual Postgres feature? Yes. You can use it directly in statements you prepare. > 4) What kind of scope do declared cursors have? I'm not exactly sure but I think it has to be the module i.e. source file. > 5) (META-QUESTION): Is ECPG suitable for a large system, i.e. an > accounting system for a small business? It should yes. If there is a problem ECPG will be fixed. Michael -- Michael Meskes | Go SF 49ers! Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire! Tel.: (+49) 2431/72651 | Use Debian GNU/Linux! Email: Michael@Fam-Meskes.De | Use PostgreSQL!