Re: DECLARE CURSOR - Mailing list pgsql-novice

From Tom Lane
Subject Re: DECLARE CURSOR
Date
Msg-id 26620.1277733617@sss.pgh.pa.us
Whole thread Raw
In response to DECLARE CURSOR  (Atif Jung <atifjung@gmail.com>)
Responses Re: DECLARE CURSOR  (Atif Jung <atifjung@gmail.com>)
List pgsql-novice
Atif Jung <atifjung@gmail.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

pgsql-novice by date:

Previous
From: Atif Jung
Date:
Subject: DECLARE CURSOR
Next
From: Atif Jung
Date:
Subject: AUTO COMMIT