OK, I have applied the following patch.  Interestingly, the SGML code
marked this block as outdated, but didn't remove it for some reason.

> On Tue, 19 Jun 2001, Michael Meskes wrote:
> 
> > On Mon, Jun 18, 2001 at 03:59:56PM -0400, Thalis A. Kalfigopoulos wrote:
> > > EXEC SQL DECLARE my_cursor CURSOR FOR SELECT a,b FROM lala WHERE a= :i;
> > > EXEC SQL FETCH FORWARD NEXT FROM my_cursor INTO :tmpa,:tmpb;
> > 
> > Is there an EXEC SQL OPEN CURSOR my_cursor in between these lines?
> > 
> > > I check the .c file generated by ecpg and the cursor declaration is commented 
>out :-(
> > 
> > That's correct. It's placed at the OPEN spot.
> 
> Correct, it works. But I was confused because the documentation 
>(http://www.postgresql.org/idocs/index.php?ecpg-develop.html) mentions:
> 
> Open cursor statement
>      An open cursor statement looks like: 
>      exec sql open cursor;
>      and is ignore and not copied from the output. 
> 
> This gave me the impression that no explicit OPEN is necessary to operate on the 
>cursor (normal Pg behavior). If not just my misunderstanding, someone rephrase thin 
>in the docs.
> 
> 
> cheers,
> thalis
> 
> > 
> > Michael
> > -- 
> > Michael Meskes
> > [EMAIL PROTECTED]
> > Go SF 49ers! Go Rhein Fire!
> > Use Debian GNU/Linux! Use PostgreSQL!
> > 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to [EMAIL PROTECTED] so that your
> message can get through to the mailing list cleanly
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: doc/src/sgml/ecpg.sgml
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ecpg.sgml,v
retrieving revision 1.18
diff -c -r1.18 ecpg.sgml
*** doc/src/sgml/ecpg.sgml      2000/12/22 21:51:57     1.18
--- doc/src/sgml/ecpg.sgml      2001/08/24 17:52:43
***************
*** 805,857 ****
         </listitem>
        </varlistentry>
  
-       <!--WARNING: FROM HERE ON THE TEXT IS OUTDATED!-->
-       <varlistentry>
-        <term>Open cursor statement</term>
-        <listitem>
-       <para>
-        An open cursor statement looks like:
-        <programlisting>
- exec sql open <replaceable>cursor</replaceable>;
-        </programlisting>
-        and is ignore and not copied from the output.
-       </para>
-        </listitem>
-       </varlistentry>
- 
-       <varlistentry>
-        <term>Commit statement</term>
-        <listitem>
-       <para>
-        A commit statement looks like
-        <programlisting>
- exec sql commit;
-        </programlisting>
-        and is translated on the output to
-        <programlisting>
- ECPGcommit(__LINE__);
-        </programlisting>
-       </para>
-        </listitem>
-       </varlistentry>
- 
-       <varlistentry>
-        <term>Rollback statement</term>
-        <listitem>
-       <para>
-        A rollback statement looks like
-        <programlisting>
- exec sql rollback;
-        </programlisting>
-        and is translated on the output to
-        <programlisting>
- ECPGrollback(__LINE__);
-        </programlisting>
-       </para>
-        </listitem>
-       </varlistentry>
- 
-       <!--STARTING HERE IT IS OKAY AGAIN!-->
        <varlistentry>
         <term>Other statements</term>
         <listitem>
--- 805,810 ----

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to