DECLARING THE CURSOR WITH HOLD

Started by Sajeev Mayandialmost 13 years ago6 messagesgeneral
Jump to latest
#1Sajeev Mayandi
Sajeev_Mayandi@symantec.com

Hi,

I am trying to declare a cursor with hold along with NO SCROLL option. I am getting syntax error. Just wondering if CURSOR WITH HOLD option supported. My code snip is.

DECLARE noncontainer NO SCROLL CURSOR WITH HOLD FOR SELECT * from phostmapping;

NOTE: The code is in plpgsql.

Thanks,

Sajeev

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Sajeev Mayandi (#1)
Re: DECLARING THE CURSOR WITH HOLD

On 05/21/2013 04:27 PM, Sajeev Mayandi wrote:

Hi,

I am trying to declare a cursor with hold along with NO SCROLL option.
I am getting syntax error. Just wondering if CURSOR WITH HOLD option
supported. My code snip is.

DECLARE noncontainer NO SCROLL CURSOR WITH HOLD FOR SELECT * from
phostmapping;

NOTE: The code is in plpgsql.

Two things.

1) The correct list for questions like this is:

pgsql-general

You can subscribe here:
http://www.postgresql.org/community/lists/subscribe/

2) When you resubmit this post the following information would be helpful:

Postgres version

The actual error message

The DECLARE statement in context, in other words show as much of the
plpgsql code as possible.

Thanks,

Sajeev

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgus-general mailing list (pgus-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgus-general

#3Sajeev Mayandi
Sajeev_Mayandi@symantec.com
In reply to: Sajeev Mayandi (#1)

Hi,

I am trying to declare a cursor with hold along with NO SCROLL option. I am getting syntax error. Just wondering if CURSOR WITH HOLD option supported. My code snip is.

DECLARE noncontainer NO SCROLL CURSOR WITH HOLD FOR SELECT * from phostmapping;

NOTE: The code is in plpgsql and postgresql version is 9.2.

Thanks,

Sajeev

#4Pavel Stehule
pavel.stehule@gmail.com
In reply to: Sajeev Mayandi (#3)
Re: DECLARING THE CURSOR WITH HOLD

Hello

2013/5/22 Sajeev Mayandi <Sajeev_Mayandi@symantec.com>:

Hi,

I am trying to declare a cursor with hold along with NO SCROLL option. I
am getting syntax error. Just wondering if CURSOR WITH HOLD option
supported. My code snip is.

DECLARE noncontainer NO SCROLL CURSOR WITH HOLD FOR SELECT * from
phostmapping;

NOTE: The code is in plpgsql and postgresql version is 9.2.

holdable cursors are not supported in plpgsql

Regards

Pavel Stehule

Thanks,

Sajeev

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Sajeev Mayandi
Sajeev_Mayandi@symantec.com
In reply to: Pavel Stehule (#4)
Re: DECLARING THE CURSOR WITH HOLD

Is there a work around to declare the cursor with hold?

Thanks,

Sajeev

On 5/22/13 10:19 AM, "Pavel Stehule" <pavel.stehule@gmail.com> wrote:

Hello

2013/5/22 Sajeev Mayandi <Sajeev_Mayandi@symantec.com>:

Hi,

I am trying to declare a cursor with hold along with NO SCROLL option.
I
am getting syntax error. Just wondering if CURSOR WITH HOLD option
supported. My code snip is.

DECLARE noncontainer NO SCROLL CURSOR WITH HOLD FOR SELECT * from
phostmapping;

NOTE: The code is in plpgsql and postgresql version is 9.2.

holdable cursors are not supported in plpgsql

Regards

Pavel Stehule

Thanks,

Sajeev

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6Pavel Stehule
pavel.stehule@gmail.com
In reply to: Sajeev Mayandi (#5)
Re: DECLARING THE CURSOR WITH HOLD

Maybe refcursors ??

All what you can do with cursors is described in
http://www.postgresql.org/docs/9.3/static/plpgsql-cursors.html

Regards

Pavel

2013/5/22 Sajeev Mayandi <Sajeev_Mayandi@symantec.com>:

Is there a work around to declare the cursor with hold?

Thanks,

Sajeev

On 5/22/13 10:19 AM, "Pavel Stehule" <pavel.stehule@gmail.com> wrote:

Hello

2013/5/22 Sajeev Mayandi <Sajeev_Mayandi@symantec.com>:

Hi,

I am trying to declare a cursor with hold along with NO SCROLL option.
I
am getting syntax error. Just wondering if CURSOR WITH HOLD option
supported. My code snip is.

DECLARE noncontainer NO SCROLL CURSOR WITH HOLD FOR SELECT * from
phostmapping;

NOTE: The code is in plpgsql and postgresql version is 9.2.

holdable cursors are not supported in plpgsql

Regards

Pavel Stehule

Thanks,

Sajeev

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general