note 104350 modified in ref.pdo-oci by danbrown
| From: | danbrown@php.net | Date: | Fri, 10 Jun 2011 15:28:14 +0000 |
| Subject: | note 104350 modified in ref.pdo-oci by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180419@lists.php.net to get a copy of this message | ||
Take note of the note at the top, this really is an experimental extension. I had a problem trying
to read data from Oracle which resulted in some strange behaviour in PHP. i.e. foreach loops not
ending, with no error messages. I also managed to get the data from Oracle into an array in PHP, but
then couldn't return the array from a function.
After pulling my hair out for a day, it turned out to be a CLOB column in Oracle that caused the
strange behaviour in PHP. I assume this extension doesn't fully support them.
Instead I've typecast it within the SQL to a VARCHAR2 which seems to resolve it:
SELECT CAST(columnx AS VARCHAR2(4000)) AS columnx ...
It might help someone else having similar issues.
--was--
Take note of the note at the top, this really is an experimental extension. I had a problem trying
to read data from Oracle which resulted in some strange behaviour in PHP. i.e. foreach loops not
ending, with no error messages. I also managed to get the data from Oracle into an array in PHP, but
then couldn't return the array from a function.
After pulling my hair out for a day, it turned out to be a CLOB column in Oracle that caused the
strange behaviour in PHP. I assume this extension doesn't fully support them?
Instead I've typecast it within the SQL to a VARCHAR2 which seems to resolve it:
SELECT CAST(columnx AS VARCHAR2(4000)) AS columnx ...
It might help someone else having similar issues.
http://php.net/manual/en/ref.pdo-oci.php