Home  |  Linux  | Mysql  | PHP  | XML
From:Hartman, Matthew Date:Wed Jun 17 15:20:52 2009
Subject:Using a PostgreSQL refcursor.
Good morning.

Is there a way to use a returned refcursor from PostgreSQL using PDO? I
have scoured the web and have yet to find a good result. Here's a few
things I've tried.

This example simply does not work.
-----
$database = Database::load(); // Returns a singleton object with PDO
connected to the database.
$sql = "select my_function();";
$p = $database->query($sql);
$p->execute();
$result = $p->fetchAll();
$p->closeCursor();
-----

This example is closer but PDO complains that the cursor is already
open.
-----
$database = Database::load(); // Returns a singleton object with PDO
connected to the database.
$sql = "BEGIN; select my_function('my_refcursor'); FETCH ALL from
'my_refcursor';";
$p = $database->query($sql);
$p->execute();
$result = $p->fetchAll();
$p->closeCursor();
-----



Matthew Hartman
Programmer/Analyst
Information Management, ICP
Kingston General Hospital
(613) 549-6666 x4294 
 
.now.

Navigate in group php.db at sever news.php.net
Previous Next


Your recent visits
DBD Oracle 1.20 ORA-24334 Error
Re: [PHP-DB] multiple finder
Re: [PHP-INSTALL] Re: PHP 5.3.0 as a module on windows
Re: [PHP-DB] mysqli error


  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants