|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-07-30 07:56 UTC] cuichangjie at gmail dot com
Description:
------------
When insert some japanese charectar (encoding type is "SJIS") using OCIBindByName and oci_execute, oracle has return the ORA-12899 error,it is seems like some addition bytes has been added after OCIBindByName.
Reproduce code:
---------------
//a table with 2 column,
//empno -- number(1)
//ename -- varchar2(6)
$stmt = oci_parse($conn, " INSERT INTO emp (empno, ename) VALUES( :0, :1)");
$ret = OCIBindByName(stmt, ':0', 1);
//error check
...
$ret = OCIBindByName(stmt, ':1', '日本語');
//error check
...
$ret = oci_execute($stmt);
//error check
...
oracle's error shows :
ORA-12899: value too large for column "USER0"."MyTable"."ename" (actual: 9, maximum: 6)]
Expected result:
----------------
The string: '日本語' should be 6 bytes,
echo strlen('日本語'); //should show us : 6
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 20:00:01 2025 UTC |
Oracle DB : 10.2.0.1.0 Oracle client versions : 10.2.0.1.0 What is the DB characterset : AL32UTF8 NLS settings used by PHP : putenv("NLS_LANG=Japanese_Japan.JA16SJIS"); Do you specify a character set in oci_connect(): no I see the problem what is, the putenv() set a wrong characterset for DB, when i have changed putenv() to AL32UTF8, the strlen() can get the same length with db for janji.