Received: from clubserv.rp-online.de (clubserv.rp-online.de [149.221.232.11]) by hub.org (8.9.3/8.9.1) with ESMTP id BAA66880 for ; Mon, 26 Apr 1999 01:28:31 -0400 (EDT) (envelope-from Michael.Meskes@gmx.net) Received: from pc63.rp-plus.de (as11-asy40.rp-plus.de [149.221.93.168]) by clubserv.rp-online.de (8.9.1a/8.9.1) with ESMTP id HAA26930; Mon, 26 Apr 1999 07:27:45 +0200 (METDST) Received: (from meskes@localhost) by pc63.rp-plus.de (8.9.3/8.9.0/Debian/GNU) id RAA00902; Sat, 24 Apr 1999 17:28:51 +0200 Date: Sat, 24 Apr 1999 17:28:51 +0200 From: Michael Meskes To: Pavel PaJaSoft Janousek Cc: PgSQL Interfaces Subject: Re: [INTERFACES] ecpg cursors and scope Message-ID: <19990424172851.E790@gmx.net> Mail-Followup-To: Pavel PaJaSoft Janousek , PgSQL Interfaces References: <00bb01be8d61$ad46e040$0200a8c0@server.fonet2.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <00bb01be8d61$ad46e040$0200a8c0@server.fonet2.cz>; from Pavel PaJaSoft Janousek on Fri, Apr 23, 1999 at 10:17:03AM +0200 On Fri, Apr 23, 1999 at 10:17:03AM +0200, Pavel PaJaSoft Janousek wrote: > Thanks, but in PostgreSQL or ECPG manual isn't this... and I forgot Shame on me. :-( Yes, the docs need much more work. > syntax from Oracle...Could you put some example (the best is the contruction > below)? Please check the test source under .../ecpg/test. How about this if (cond) strcpy(query, "select count (*) from tpm"); else strcpy(query, "select count (*) from tpm where col1 = ?"); exec sql prepare MM from :query; exec sql declare prep cursor for MM; exec sql open prep using :cislo1; exec sql whenever not found break; while (1) { exec sql fetch in cur into :cislo2; } But speaking of this. It appears ecpg cannot do prepares without variables at the moment. This is a bug. I just didn't see this so far. 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.Meskes@gmx.net | Use PostgreSQL!