clob bug!
clob bug!
my OS: Windows Xp sp2 chinese
Oracle: oracle 10.2
oracle charset:ZHS16GBK
ODAC version:ODAC 5.8.0.38
delphi :delphi 2006
In your clob demo . I didn't change the orasession 's config.
IN NET mode:
when the clob field only have english. it works fine.
but when the clob filed have chinese . it show
" ORA-22921: length of input buffer is smaller than amount requested"
IN OCI mode:
both chinses and english work fine.
how to use chinese clob in NET mode?
Oracle: oracle 10.2
oracle charset:ZHS16GBK
ODAC version:ODAC 5.8.0.38
delphi :delphi 2006
In your clob demo . I didn't change the orasession 's config.
IN NET mode:
when the clob field only have english. it works fine.
but when the clob filed have chinese . it show
" ORA-22921: length of input buffer is smaller than amount requested"
IN OCI mode:
both chinses and english work fine.
how to use chinese clob in NET mode?
Last edited by xalion on Sun 14 Jan 2007 02:41, edited 1 time in total.
Please state your server and client charset separately.
Also, a sample chinese input in hexadecimal format would help to debug this problem.
Do you name your tables and table columns in Chinese too ?
ODAC is developed on English computers, English operating system and English database engine, hence Chinese input is as alien to them as Zeti-Reticulian.
If duplicating your problem requires installation of Chinese Windows, I doubt anyone would even want to go through the trouble of the installation process.
I myself, would not even be able to complete the installation of Chinese Windows because it is so alien to me. Chinese characters look like little shrubs to us in the rest of the world, and they make much more sense to us in the form of hexadecimal code than their native form.
BTW: I am from Poland and English is not my first language either.
Also, a sample chinese input in hexadecimal format would help to debug this problem.
Do you name your tables and table columns in Chinese too ?
ODAC is developed on English computers, English operating system and English database engine, hence Chinese input is as alien to them as Zeti-Reticulian.
If duplicating your problem requires installation of Chinese Windows, I doubt anyone would even want to go through the trouble of the installation process.
I myself, would not even be able to complete the installation of Chinese Windows because it is so alien to me. Chinese characters look like little shrubs to us in the rest of the world, and they make much more sense to us in the form of hexadecimal code than their native form.
BTW: I am from Poland and English is not my first language either.
some hints
I think the problem should be :
Oracle get length of the chinese string as a logic length.
like select length('中国') from dual result=2
select length('中国and') from dual result=5
but in delphi length('中国')=4
length('中国and')=7
so when ODAC trans clob field to oracle,
like ParamByName('Value').AsOraClob.Asstring :='中国'.
ODAC tell Oracle the clob field size is 4.
and oracle get the string and find the size is 2.
so it show ORA-22921: length of input buffer is smaller than amount requested.
Oracle get length of the chinese string as a logic length.
like select length('中国') from dual result=2
select length('中国and') from dual result=5
but in delphi length('中国')=4
length('中国and')=7
so when ODAC trans clob field to oracle,
like ParamByName('Value').AsOraClob.Asstring :='中国'.
ODAC tell Oracle the clob field size is 4.
and oracle get the string and find the size is 2.
so it show ORA-22921: length of input buffer is smaller than amount requested.
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
thank you for reply
I set ZHS16GBK charset for the Charset option of TOraSession component.
It caused the same error!
when I set useunicode=true , In your clob demos , when I click the
open button , the demo hangs, and don't responed anymore.
by the way. I used the newst ODAC 5.8.0.39 .
It caused the same error!
when I set useunicode=true , In your clob demos , when I click the
open button , the demo hangs, and don't responed anymore.
by the way. I used the newst ODAC 5.8.0.39 .
I use odac 6.25.2.14 now!
but when i use follow code;
for i:=1 to 100000 do
s:=s+'好';
params[0].AsOraClob.Asstring:=s;
insert into don't show error.
but when I select the data from database,
it return a string which size is about 289000.
there are many spaces in the the string.
the string format like '好好.................好'+' ........ '+'好好...................好'+' ........... '+'好好.................好' .
and each spaces string about 32K.
why ?
but when i use follow code;
for i:=1 to 100000 do
s:=s+'好';
params[0].AsOraClob.Asstring:=s;
insert into don't show error.
but when I select the data from database,
it return a string which size is about 289000.
there are many spaces in the the string.
the string format like '好好.................好'+' ........ '+'好好...................好'+' ........... '+'好好.................好' .
and each spaces string about 32K.
why ?