Bug #63809 [Com]: ORA-01461 when inserting/updating more that 1333 characters

2013-08-07 Thread zulrang at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=63809&edit=1

 ID: 63809
 Comment by: zulrang at gmail dot com
 Reported by:blair dot chesnut at gmail dot com
 Summary:ORA-01461 when inserting/updating more that 1333
 characters
 Status: Open
 Type:   Bug
 Package:PDO related
 Operating System:   Unix/Solaris 10
 PHP Version:5.4.9
 Block user comment: N
 Private report: N

 New Comment:

You can get around this by adding the size to the bind statement:

$sth->bindValue(':p1', $big_value, PDO::PARAM_STR, 4000);


Previous Comments:

[2012-12-23 23:16:15] s...@php.net

See also https://bugs.php.net/bug.php?id=54379

value_sz is set to allow for character set conversion due to different client 
and 
server character sets.  This might increase the storage requirements when the 
data is stored in the server. The hardcoded choice of the ratio is questionable.


[2012-12-19 19:42:49] blair dot chesnut at gmail dot com

Description:

Using PDO/OCI via Yii framework. Inserts/updates to varchar2(4000) column fail 
with error ORA-01461 when value exceeds 1332 characters. 

Line 300 of source php-5.4.9/ext/pdo_oci/oci_statement.c:

value_sz = 1332; /* maximum size before value is interpreted as a LONG value */

Why???  

I changed to "value_sz = 4000", recompiled, and inserts/updates work fine. I'm 
not using CLOBs, only varchar2() columns. 


Test script:
---
$dbh = new PDO($dsn, $dbuser, $dbpass);
 
$sth = $dbh->prepare('insert into some_table (some_varchar4000_column) values 
(:p1)');
 
$big_value = str_repeat('ABCDEFGHIJ', 300);
$sth->bindValue(':p1', $big_value, PDO::PARAM_STR);
 
$sth->execute();
print_r($sth->errorInfo());


Expected result:

Array
(
[0] => 0
[1] => 
[2] => 
)


Actual result:
--
Array
(
[0] => HY000
[1] => 1461
[2] => OCIStmtExecute: ORA-01461: can bind a LONG value only for insert 
into a LONG column
 (/usr/local/src/php-5.4.5/ext/pdo_oci/oci_statement.c:146)
)







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


Bug #40787 [Com]: Error trying to insert into a CLOB column when using multi-byte charset.

2012-08-17 Thread zulrang at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=40787&edit=1

 ID: 40787
 Comment by: zulrang at gmail dot com
 Reported by:jarismar at adplabs dot com dot br
 Summary:Error trying to insert into a CLOB column when using
 multi-byte charset.
 Status: Assigned
 Type:   Bug
 Package:PDO related
 PHP Version:5.2.1
 Assigned To:sixd
 Block user comment: N
 Private report: N

 New Comment:

What's the status on this bug?  I'm still experiencing the problem in 5.3.15!


Previous Comments:

[2011-01-28 14:55:42] john dot doe at trash-mail dot com

Is there any workaround or alternative for PHP 5.2.6 which is stable on Debian 
Lenny or is PDO not usable on this version? (I mean not usable because without 
fetching affected rows of INSERT, UPDATE, DELTE statements it's nearly 
impossible to write secure code).


[2010-05-26 15:05:16] firegun at thehummels dot org

I`m having the same problem described here, I´m using the Doctrine library, 
running on lastest php version (5.3+) and oracle XE, with the charset AL32UTF8. 
Any ideas on a working solution? Comeon guys this is a 2007 bug... ;/


[2009-11-02 20:35:05] paj...@php.net

Assigned it to someone more active :)


[2009-11-02 20:06:16] markus at computino dot de

Still a valid bug, cost me multiple hours trying to work it out before I found 
the bug report. Now using adodb/oci8.


[2009-04-30 19:57:19] jarismar at adplabs dot com dot br

Status changed to open again.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=40787


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