Re: Operations widh CURSORS

From: Jurgen Defurne <defurnj(at)glo(dot)be>
To: Marcos Barreto de Castro <mbdecastro(at)yahoo(dot)com>, postgreSQL general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Operations widh CURSORS
Date: 2000-06-03 05:57:36
Message-ID: 39389E4F.A907ECA8@glo.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Marcos Barreto de Castro wrote:

> Hi,
>
> Is it possible to declare 2 cursors in the same
> transaction?
> I am issuing a "BEGIN WORK" statement, after that I
> am issuing "DECLARE c_cursor FOR SELECT * FROM table".
> When, after that, I issue "DECLARE c_cursor1 FOR
> SELECT COUNT(*) FROM table" I get a segmentation
> fault.
> Is there a way to avoid this and still be able to
> open 2 cursors in the same transaction?
> Thanks a lot.
>
> Marcos Castro
> email: mbdecastro(at)yahoo(dot)com
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos -- now, 100 FREE prints!
> http://photos.yahoo.com

You do not need to declare your cursors inside your transaction. A
cursor
is like a kind of data structure : you declare it and then you use it
at will whenever you need it.

<Declare cursors here>

BEGIN WORK;

-- Open cursors here

-- Work with cursors here

-- COMMIT or ROLLBACK, depending on the outcome of your program

Jurgen Defurne
defurnj(at)glo(dot)be

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jurgen Defurne 2000-06-03 06:16:04 Re: to pickle or not to pickle
Previous Message Peter Eisentraut 2000-06-02 23:47:53 Re: [HACKERS] Oft Ask: How to contribute to PostgreSQL?