Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15930 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73860 invoked by uid 1010); 9 Apr 2005 14:46:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 73368 invoked from network); 9 Apr 2005 14:46:42 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 9 Apr 2005 14:46:42 -0000 X-Host-Fingerprint: 212.250.162.15 smtpout15.mailhost.ntl.com Solaris 8 (1) Received: from ([212.250.162.15:33950] helo=mta05-winn.mailhost.ntl.com) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id 24/30-19272-8AAE7524 for ; Sat, 09 Apr 2005 10:46:00 -0400 Received: from aamta01-winn.mailhost.ntl.com ([212.250.162.8]) by mta05-winn.mailhost.ntl.com with ESMTP id <20050409144546.VXPS18313.mta05-winn.mailhost.ntl.com@aamta01-winn.mailhost.ntl.com>; Sat, 9 Apr 2005 15:45:46 +0100 Received: from win2ks ([213.107.8.99]) by aamta01-winn.mailhost.ntl.com with ESMTP id <20050409144546.JPDC1187.aamta01-winn.mailhost.ntl.com@win2ks>; Sat, 9 Apr 2005 15:45:46 +0100 Reply-To: To: "'Dan Scott'" , Date: Sat, 9 Apr 2005 15:46:37 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: Thread-Index: AcU9ETAP6yx8/fDOS7SjZ7sYr3KvOgAAPrwg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: <20050409144546.JPDC1187.aamta01-winn.mailhost.ntl.com@win2ks> Subject: RE: [PHP-DEV] PDO proposal: add PDOStatement::nextResult() method to support stored procedures From: jared.williams1@ntlworld.com ("Jared Williams") References: > > I've been writing a chapter on database programming with PHP, > using PDO, and ran across a scenario that has not yet been > fulfilled by the PDO API. Many databases (Apache Derby, DB2, > Microsoft SQL Server, MySQL 5, and PostgreSQL to a certain > extent) support stored procedures that can return multiple > result sets. Database APIs typically set the result set > pointer to the first row of the first result set returned, > allow the application to iterate through the rows, and > provide some method to request the second result set from the > database server. > > In ODBC, for example, you would call SQLFetch() to iterate > through the rows of the first result set, then call > SQLNextResult() to request the next result set. > > In the PHP realm, Unified ODBC defines odbc_next_result(); > mssql defines mssql_next_result(); PEAR::DB defines > DB_Result:nextResult(). > > PDO, however, currently provides no means of working with the > second or subsequent result sets returned from a call to a > stored procedure. > > To build on the established naming practice from existing > database extensions, I propose that the PDO interface define > the standard > method: > /* {{{ proto bool PDOStatement::nextResult(void) Requests the > next result set from the database */ > > Thanks, > Dan > > Note: somewhat confusingly, mysqli defines > mysqli_next_result(), but this is used to retrieve the > results of a multi-query... a very different thing, and not > something I advocate adding to PDO. They might have trouble > disambiguating that from the stored procedure case when MySQL > 5 reaches production status. > Doesn't PDOStatement::nextRowset() do this? Jared