Bug #63809 [Opn->Dup]: ORA-01461 when inserting/updating more that 1333 characters
| From: | cmb@php.net | Date: | Mon, 26 Jul 2021 18:00:26 +0000 |
| Subject: | Bug #63809 [Opn->Dup]: ORA-01461 when inserting/updating more that 1333 characters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235373@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63809&edit=1
ID: 63809
Updated by: cmb@php.net
Reported by: blair dot chesnut at gmail dot com
Summary: ORA-01461 when inserting/updating more that 1333
characters
-Status: Open
+Status: Duplicate
Type: Bug
Package: PDO OCI
Operating System: Unix/Solaris 10
PHP Version: 5.4.9
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Indeed, duplicate of bug #55138.
Previous Comments:
------------------------------------------------------------------------
[2021-04-29 07:27:09] akilas at omobio dot net
Hi,
I'm getting the below error... doing an update with PDO using php 7.4.16
General error: 1461 OCIStmtExecute: ORA-01461: can bind a LONG value only for insert into a LONG
column
with pdo version php-pdo-7.4.16 any solution for this???
------------------------------------------------------------------------
[2014-03-27 09:38:15] gureedo at gmail dot com
This is duplicate. See same bug reported earlier:
https://bugs.php.net/bug.php?id=55138
------------------------------------------------------------------------
[2013-08-07 15:40:57] zulrang at gmail dot com
You can get around this by adding the size to the bind statement:
$sth->bindValue(':p1', $big_value, PDO::PARAM_STR, 4000);
------------------------------------------------------------------------
[2012-12-23 23:16:15] sixd@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] => 00000
[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