go to bug id or search bugs for
I have compiled last sources from https://github.com/php/php-src/tree/master/ext/pdo_oci.
Data from NCLOB type is not returned in the row. From CLOB or NVARCHAR2 is all ok.
$options = array(
PDO::ATTR_STRINGIFY_FETCHES => true,
$dbh = new PDO('dns', 'username', 'password', $options);
$stmt = $dbh->query('select NCLOB_COLUMN from TABLE');
$row = $stmt->fetch(PDO::FETCH_ASSOC);
Add a Patch
Add a Pull Request
Related To: Bug #68327
This is "expected" since support for NCLOB or NVARCHAR has not been implemented in PDO_OCI (or to the OCI8 extension).
From http://docs.oracle.com/database/121/NLSPG/ch2charset.htm#NLSPG180 :
"Oracle recommends using SQL CHAR, VARCHAR2, and CLOB data types in
AL32UTF8 database to store Unicode character data. Use of SQL NCHAR,
NVARCHAR2, and NCLOB should be considered only if you must use a
database whose database character set is not AL32UTF8."
I have tested via oci, and it is working fine with NCLOB data type. That's why I thought it is a bug.
$dbh = oci_connect($username, $passwd, $tsa, 'UTF8');
$stmt = oci_parse($dbh, 'select * from "Feedbacks"');
$row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_LOBS);