Re: Oracle PDO UTF-8 problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Glad you resolved it.

Overall, I have to recommend the OCI8 extension over the unmaintained
(like much of PDO) PDO_OCI extension.

Chris

On 01/13/2011 11:36 PM, Karsten Lehmann wrote:
I found out that the error depends on the wrong character set of the Oracle Database. In my case this was a Western Europ instance of the Database. The same data on a UTF8 instance was displayed as excpected.

Am 13.01.2011 10:42, schrieb Karsten Lehmann:
Doesn't work.

I got the following error after i set the parameter in the PDO construct

Fatal error: Undefined class constant 'MYSQL_ATTR_MAX_BUFFER_SIZE'

IMHO this is only a MYSQL parameter but i worked with oracle.

Am 13.01.2011 10:27, schrieb kesavan trichy rengarajan:
Try increasing this: PDO::MYSQL_ATTR_MAX_BUFFER_SIZE

More info here: http://php.net/manual/en/ref.pdo-mysql.php
On Thu, Jan 13, 2011 at 7:23 PM, Karsten Lehmann<lehmann@xxxxxxxxxx>
wrote:

Hello

I try to read a 2000 character long string out of database. The
database is
an oracle 10g Express Edition with UTF-8 character set. To read the
string
we use the PDO abstraction layer with oci-driver. If the 2000 character
contains one or more UTF-8 characters we get the problem that PDO
truncate
the result of the database, with the following message:

Warning: PDOStatement::fetchAll() [pdostatement.fetchall]: column 5 data
was too large for buffer and was truncated to fit it in
C:\wamp\www\wp\bp.php on line 115


The definition of the database column is

TESTSTRING VARCHAR2(2000 CHAR)

CHAR means that we can store up to 2000 characters independent from the
encoding of the character (e.g. UTF8).


I also init the PDO with UTF8

$dbh = new PDO('oci:dbname=' . $db_name . ';charset=UTF8', $db_user,
$db_pw);


If i read the same string with java and JDBC-driver it works fine, so
i can
exclude a database error.

How i have to configre PHP/PDO to be aware of the truncation of the
result
string?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







--
Email: christopher.jones@xxxxxxxxxx
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux