Re: DECLARE CURSOR

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Atif Jung <atifjung(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: DECLARE CURSOR
Date: 2010-06-28 14:00:17
Message-ID: 26620.1277733617@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Atif Jung <atifjung(at)gmail(dot)com> writes:
> I'm getting an error msg which reads:
> DECLARE CURSOR can only be used in transaction blocks.

> does that mean to DECLARE a cursor I must surrond it with a BEGIN & COMMIT
> work?

Yes. The cursor automatically disappears as soon as you commit, so it'd
be useless otherwise.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Atif Jung 2010-06-28 14:56:51 AUTO COMMIT
Previous Message Atif Jung 2010-06-28 11:27:01 DECLARE CURSOR