X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id A5073D1B50F for ; Sun, 5 Oct 2003 12:22:31 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 23600-09 for ; Sun, 5 Oct 2003 09:21:48 -0300 (ADT) Received: from mail.hive.nj2.inquent.com (mc.carriermail.com [205.178.180.9]) by svr1.postgresql.org (Postfix) with SMTP id 4E50AD1B4ED for ; Sun, 5 Oct 2003 09:21:29 -0300 (ADT) Received: (qmail 9218 invoked from network); 5 Oct 2003 12:21:32 -0000 Received: from unknown (HELO ?192.168.1.199?) (134.22.136.235) by 205.178.180.9 with SMTP; 5 Oct 2003 12:21:32 -0000 Subject: Re: How to manipulate a cursor returned by a PL/pgSQL in a PHP From: Rod Taylor To: akopciuch@olympusproject.org Cc: sebastien.baudry@baudry-engineering.com, Sebastien BAUDRY , pgsql-php@postgresql.org In-Reply-To: <200310050238.37577.akopciuch@olympusproject.org> References: <20031005073201.91481.qmail@web13807.mail.yahoo.com> <200310050238.37577.akopciuch@olympusproject.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-1NorercR+shwkG4z93G3" Message-Id: <1065356520.23288.144.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sun, 05 Oct 2003 08:22:02 -0400 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/10 X-Sequence-Number: 2371 --=-1NorercR+shwkG4z93G3 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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? > > >=20 > 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. --=-1NorercR+shwkG4z93G3 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/gAzo6DETLow6vwwRAk16AJ9hFpqf0WNOow9joG4atfa2RPz66QCeMfi0 MxLNhTanPgpwRLAzzHM2a9o= =a0e6 -----END PGP SIGNATURE----- --=-1NorercR+shwkG4z93G3--