Skip site navigation (1) Skip section navigation (2)

Re: How to manipulate a cursor returned by a PL/pgSQL in a PHP

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: akopciuch(at)olympusproject(dot)org
Cc: sebastien(dot)baudry(at)baudry-engineering(dot)com,Sebastien BAUDRY <sbaudry(at)yahoo(dot)com>, pgsql-php(at)postgresql(dot)org
Subject: Re: How to manipulate a cursor returned by a PL/pgSQL in a PHP
Date: 2003-10-05 12:22:02
Message-ID: 1065356520.23288.144.camel@jester (view raw or flat)
Thread:
Lists: pgsql-php
On Sun, 2003-10-05 at 04:38, Andrew J. Kopciuch wrote:
> On Sunday 05 October 2003 01:32, Sebastien BAUDRY wrote:
> > Hi.
> > My function returns a cursor and I don't know how to
> > fetch the cursor in my PHP script.
> > Anybody could help me?
> >
> 
> PHP does not directly support cursors under PostgreSQL.  :-(

Huh? Cursors in PostgreSQL are accessible via the standard query
interface within PHP.

It's 2 queries, one to create the cursor, one to request the number of
tuples. PHP does not need any special logic to handle this.

pg_query('DECLARE thecursor CURSOR FOR ....')

pg_query('FETCH ...');

The fetch will act just like a select in regards to returned data.

In response to

Responses

pgsql-php by date

Next:From: Andrew J. KopciuchDate: 2003-10-05 15:21:47
Subject: Re: How to manipulate a cursor returned by a PL/pgSQL in a PHP
Previous:From: Andrew J. KopciuchDate: 2003-10-05 08:38:36
Subject: Re: How to manipulate a cursor returned by a PL/pgSQL in a PHP script?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group