- Table for test
CREATE TABLE mytable (col1 NVARCHAR2(20));
- Test data
INSERT INTO mytable VALUES('12345678901234567890'); /* 20 signle byte char */
INSERT INTO mytable VALUES('あいうえおかきくけこさしすせそたちつてと'); /* 20 double byte char, Japanese */
- Test Program
<?php
print "NLS_LANG=".getenv('NLS_LANG')."\n\n";
$db = new PDO("oci:dbname=//instance1.cf9klgqzy0gu.ap-northeast-1.rds.amazonaws.com:3306/mydb;charset=AL32UTF8", "user", "pass");
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$stmt = $db->prepare("SELECT * FROM mytable");
$stmt->execute();
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
?>
- Test Program Output
# php ocitest.php
NLS_LANG=Japanese_Japan.AL32UTF8
Warning: PDOStatement::fetchAll(): column 0 data was too large for buffer and was truncated to fit it in /root/ocitest.php on line 9
array(2) {
[0]=>
array(1) {
["COL1"]=>
string(20) "12345678901234567890"
}
[1]=>
array(1) {
["COL1"]=>
string(40) "あいうえおかきくけこさしす
}
}--
Grupo PHPBA
http://groups.google.com.br/group/phpba?hl=pt-BR?hl=pt-BR
resources.db.params.host = "ftidb1d"
resources.db.params.username = "*****"
resources.db.params.password = "*****"
resources.db.port = 1521resources.db.params.charset = "UTF8"
| ( ! ) Warning: PDOStatement::fetchAll() [pdostatement.fetchall]: column 1 data was too large for buffer and was truncated to fit it in C:\wamp\www\library\Zend\Db\Statement\Pdo.php on line 290 | ||||
|---|---|---|---|---|
| Call Stack | ||||
| # | Time | Memory | Function | Location |
| 1 | 0.0011 | 392040 | {main}( ) | ..\index.php:0 |
| 2 | 0.2644 | 6834520 | Zend_Application->run( ) | ..\index.php:54 |
| 3 | 0.2645 | 6834520 | Zend_Application_Bootstrap_Bootstrap->run( ) | ..\Application.php:366 |
| 4 | 0.2646 | 6834576 | Zend_Controller_Front->dispatch( ) | ..\Bootstrap.php:97 |
| 5 | 0.2827 | 7514288 | Zend_Controller_Dispatcher_Standard->dispatch( ) | ..\Front.php:954 |
| 6 | 0.4225 | 8779960 | Zend_Controller_Action->dispatch( ) | ..\Standard.php:295 |
| 7 | 0.4226 | 8784552 | ConsumidorController->addAction( ) | ..\Action.php:513 |
| 8 | 0.4349 | 9762696 | ConsumidorForm->__construct( ) | ..\ConsumidorController.php:31 |
| 9 | 0.4351 | 9764496 | App_Form_Abstract->__construct( ) | ..\ConsumidorForm.php:24 |
| 10 | 0.4359 | 9768160 | ZendX_JQuery_Form->__construct( ) | ..\Abstract.php:14 |
| 11 | 0.4361 | 9769720 | Zend_Form->__construct( ) | ..\Form.php:47 |
| 12 | 0.4361 | 9769720 | ConsumidorForm->init( ) | ..\Form.php:240 |
| 13 | 2.5148 | 11548256 | Mapper_Localidade->fetchAll( ) | ..\ConsumidorForm.php:86 |
| 14 | 2.5148 | 11548256 | App_Db_Mapper_Abstract->fetchAll( ) | ..\Localidade.php:66 |
| 15 | 2.5148 | 11548256 | Zend_Db_Table_Abstract->fetchAll( ) | ..\Abstract.php:98 |
| 16 | 3.2243 | 11558136 | App_Db_Abstract->_fetch( ) | ..\Abstract.php:1321 |
| 17 | 3.2243 | 11558136 | Zend_Db_Table_Abstract->_fetch( ) | ..\Abstract.php:108 |
| 18 | 3.2641 | 11563704 | Zend_Db_Statement_Pdo_Oci->fetchAll( ) | ..\Abstract.php:1506 |
| 19 | 3.2641 | 11563736 | Zend_Db_Statement_Pdo->fetchAll( ) | ..\Oci.php:57 |
| 20 | 3.2641 | 11563768 | PDOStatement->fetchAll( ) | ..\Pdo.php:290 |
| Variables in local scope (#19) | ||||
$col = | null | |||
$e = | Undefined | |||
$style = | int 2 | |||
VARCHAR2(11 BYTE)
VARCHAR2(11 CHAR)
| 20 | 3.2641 | 11563768 | PDOStatement->fetchAll( ) | ..\Pdo.php:290 |