|
Posted by Mladen Gogala on 09/25/05 19:24
On Sun, 25 Sep 2005 11:26:03 +0100, Andy Hassall wrote:
> The Oracle-related changes in PHP included in Zend Core for Oracle are, if I
> understand correctly, basically just in the new OCI8 driver. This is being
> released back into the core distribution when it's stable, and is already
> available separately through PECL in beta status:
>
> http://pecl.php.net/package/oci8
The latest PECL oci8 extension doesn't work with PHP 5.1.0RC1. Here is
what I get when I run it with "extension=oci8.so":
[Sun Sep 25 12:07:38 2005] [notice] child pid 28695 exit signal Segmentation fault (11)
When I disable it, it runs fine. I linked PHP with the extension that
comes with PHP5.1 (--with-oci8=$ORACLE_HOME) and it works.
Did you play with PDO_OCI? I am disappointed by the fact that it cannot
describe a cursor. The following little program fails: $ cat test_pdo.php
#!/usr/local/bin/php <?php
$SQL1="select * from emp where ename like :ENAME"; $name='%'; try {
$dbh = new PDO("oci:dbname=local", "scott", "tiger");
$sth=$dbh->prepare($SQL1);
$sth->bindParam(":ENAME",$name,PDO_PARAM_STR,100);
$sth->execute();
$cnt=$sth->columnCount();
echo "This statement returns ",$cnt, " columns\n";
for($i=0;$i<$cnt;$i++) {
print_r($sth->getColumnMeta($i));
print("\n");
}
} catch (PDOException $e) {
echo "Failed to obtain database handle " . $e->getMessage(),"<br>\n";
}
?>
Here is what happens:
$ ./test_pdo.php
This statement returns 8 columns
PHP Warning: PDOStatement::getColumnMeta(): SQLSTATE[IM001]: Driver does not support this function: driver doesn't support meta data in /home/mgogala/tmp/test_pdo.php on line 13
PHP Warning: PDOStatement::getColumnMeta(): SQLSTATE[IM001]: Driver does not support this function: driver doesn't support meta data in /home/mgogala/tmp/test_pdo.php on line 13
PHP Warning: PDOStatement::getColumnMeta(): SQLSTATE[IM001]: Driver does not support this function: driver doesn't support meta data in /home/mgogala/tmp/test_pdo.php on line 13
PHP Warning: PDOStatement::getColumnMeta(): SQLSTATE[IM001]: Driver does not support this function: driver doesn't support meta data in /home/mgogala/tmp/test_pdo.php on line 13
PHP Warning: PDOStatement::getColumnMeta(): SQLSTATE[IM001]: Driver does not support this function: driver doesn't support meta data in /home/mgogala/tmp/test_pdo.php on line 13
PHP Warning: PDOStatement::getColumnMeta(): SQLSTATE[IM001]: Driver does not support this function: driver doesn't support meta data in /home/mgogala/tmp/test_pdo.php on line 13
PHP Warning: PDOStatement::getColumnMeta(): SQLSTATE[IM001]: Driver does not support this function: driver doesn't support meta data in /home/mgogala/tmp/test_pdo.php on line 13
PHP Warning: PDOStatement::getColumnMeta(): SQLSTATE[IM001]: Driver does not support this function: driver doesn't support meta data in /home/mgogala/tmp/test_pdo.php on line 13
Basically, what is says is that driver doesn't support returning column
name, type, length, scale an precision for returned column in a query.
That functionality is, of course, available in the existing OCI8 driver.
--
http://www.mgogala.com
Navigation:
[Reply to this message]
|