Re: Cursor - Mailing list pgsql-sql

From Joe
Subject Re: Cursor
Date
Msg-id 48A7224F.50604@freedomcircle.net
Whole thread Raw
In response to Cursor  ("Xavier Bermeo" <xbermeo@gmail.com>)
List pgsql-sql
Xavier Bermeo wrote:
> Hi, guys.......
>  
> I have  problems with cursosrs.
>  
> Anyone have an example complete the how  load and read each position 
> of a cursor?
>  
> I wait your answer........
>  
> Thanks.......guys

Assuming you're using ECPG, there are a couple of examples in the 
documentation, e.g.,

http://www.postgresql.org/docs/8.3/static/ecpg-commands.html(see Select using cursors:

http://www.postgresql.org/docs/8.3/static/ecpg-variables.html#AEN33442

The essence is you DECLARE the cursor, OPEN it and then FETCH rows in 
some kind of loop, and finish by CLOSE cursor.  To exit the loop, you 
can check sqlca.sqlcode for 100 (NOT FOUND) or a SQLSTATE of 02000.

Joe


pgsql-sql by date:

Previous
From: "Xavier Bermeo"
Date:
Subject: Cursor
Next
From: Andreas Kraftl
Date:
Subject: INSERT or UPDATE