Req #68326 [Com]: Data from NCLOB column is not returned from PDO_OCI Statement

From: Date: Thu, 30 Oct 2014 11:22:39 +0000
Subject: Req #68326 [Com]: Data from NCLOB column is not returned from PDO_OCI Statement
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188375@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68326&edit=1

 ID:                 68326
 Comment by:         contact at greg dot md
 Reported by:        contact at greg dot md
 Summary:            Data from NCLOB column is not returned from PDO_OCI
                     Statement
 Status:             Open
 Type:               Feature/Change Request
 Package:            PDO OCI
 Operating System:   Mac OS X
 PHP Version:        5.4.34
 Block user comment: N
 Private report:     N

 New Comment:

Ok.

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"');
oci_execute($stmt);
$row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_LOBS);
v($row);


Previous Comments:
------------------------------------------------------------------------
[2014-10-30 10:41:43] sixd@php.net

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."

------------------------------------------------------------------------
[2014-10-29 19:30:36] requinix@php.net

Related To: Bug #68327

------------------------------------------------------------------------
[2014-10-29 19:23:21] contact at greg dot md

Description:
------------
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.

Test script:
---------------
$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);

var_dump($row);




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=68326&edit=1


Thread (3 messages)

« previous php.bugs (#188375) next »