Re: Issue with PQdescribePortal to describe a select cursor - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Issue with PQdescribePortal to describe a select cursor
Date
Msg-id 29464.1188322195@sss.pgh.pa.us
Whole thread Raw
In response to Re: Issue with PQdescribePortal to describe a select cursor  ("Brijesh Shrivastav" <Bshrivastav@esri.com>)
Responses Re: Issue with PQdescribePortal to describe a select cursor
List pgsql-interfaces
"Brijesh Shrivastav" <Bshrivastav@esri.com> writes:
> Please see the test program below that creates a table and then
> queries it using DECLARE CURSOR statement.

Well, you only prepared the DECLARE CURSOR command, you didn't execute
it --- so there's no cursor, only a prepared statement sitting waiting
to be used.

Once you execute the DECLARE CURSOR, you should be able to describe its
portal in advance of fetching any rows from it.  Or is that not what
you wanted?

> ... (in many
> cases I need input bind parameter data from client application
> before executing the query).

I think you might be looking for Describe Statement (on a prepared
statement) rather than Describe Portal.  You have to have already
provided parameter values in order to have a portal at all...
        regards, tom lane


pgsql-interfaces by date:

Previous
From: "Brijesh Shrivastav"
Date:
Subject: Re: Issue with PQdescribePortal to describe a select cursor
Next
From: "Brijesh Shrivastav"
Date:
Subject: Re: Issue with PQdescribePortal to describe a select cursor