Warning: PDOStatement::fetch() [<a href='pdostatement.fetch'>pdostatement.fetch</a>]: column 3 data was too large for buffer and was truncated to fit it in
問題,就是使用PDO_OCI 從Oracle 中取數據,報錯或是數據被截取了,顯示不完整。像這樣……php
column XXX data was too large for buffer and was truncated to fit it in XXX
那麼有兩種方案 git
1 修改源碼 oci_statement.c (估計不少人不敢動)github
php-src 中有了必定解答-修改原文件,不過 修改 ext / pdo_oci / oci_statement.c sql
531-535行 https://github.com/php/php-src/pull/59/files oracle
col->precision = scale; - col->maxlen = data_size; + col->maxlen = ( data_size + 1 ) * sizeof(utext); col->namelen = namelen; col->name = estrndup((char *)colname, namelen);
這種方式進行修改。聽說是有用的 可是看過https://github.com/php/php-src/pull/59 github上並無被採納,說明仍是有必定的問題。app
2 經過sql 處理 ide
那麼,幸虧 仔細讀了讀了找着了https://bugs.php.net/bug.php?id=35003 函數
We found a "solution" to get it work: select cast( tbl.description AS varchar2(300) )as desc FROM database.table tbl;
使用 oracle 的 cast()函數進行轉換 ,這樣就能夠了 IT Work !fetch
//-------------------------------------------------------------------- ui
其餘:關於 utext 是個啥? 或許是吧,就是轉ut8用的??
http://code.metager.de/source/xref/WebKit/Source/WebCore/icu/unicode/utext.h
http://userguide.icu-project.org/strings/utext
UText is a text abstraction facility for ICU
The intent is to make it possible to extend ICU to work with text data that is in formats above and beyond those that are native to ICU.
UText makes it possible to extend ICU to work with text that
Is stored in UTF-8 or UTF-32 format.
Is in strings that are stored in discontiguous chunks in memory, or in application-specific representations.
Is in a non-Unicode code page