clob bug!

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
xalion
Posts: 124
Joined: Fri 20 May 2005 10:08

clob bug!

Post by xalion » Sat 13 Jan 2007 03:38

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?
Last edited by xalion on Sun 14 Jan 2007 02:41, edited 1 time in total.

Horace
Posts: 40
Joined: Thu 11 May 2006 23:37

Post by Horace » Sat 13 Jan 2007 13:16

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.

xalion
Posts: 124
Joined: Fri 20 May 2005 10:08

some hints

Post by xalion » Sun 14 Jan 2007 04:05

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.

Horace
Posts: 40
Joined: Thu 11 May 2006 23:37

Post by Horace » Sun 14 Jan 2007 18:36

Do you think that "the problem should be" or that "the problem is" ?

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Mon 15 Jan 2007 13:34

Please check that you have specified the ZHS16GBK charset for the Charset option of TOraSession component. Or set UseUnicode options to True and use AsWideString property.

xalion
Posts: 124
Joined: Fri 20 May 2005 10:08

thank you for reply

Post by xalion » Tue 16 Jan 2007 01:00

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 .

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 22 Jan 2007 10:40

Try to set the Charset option of the TOraSession component to ZHT16MSWIN950. Value of the Charset option should correspond to your operating system character set.

xalion
Posts: 124
Joined: Fri 20 May 2005 10:08

:)

Post by xalion » Tue 23 Jan 2007 09:27

Try to set the Charset option of the TOraSession component to ZHT16MSWIN950. Value of the Charset option should correspond to your operating system character set.
same error!

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 24 Jan 2007 08:46

We have reproduced this problem and we are working on it. You will be notified when we fix the problem.

xalion
Posts: 124
Joined: Fri 20 May 2005 10:08

Post by xalion » Sat 08 Mar 2008 13:48

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 ?

xalion
Posts: 124
Joined: Fri 20 May 2005 10:08

Post by xalion » Tue 11 Mar 2008 05:36

another hints:
if length(s)<64k everything is ok!

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 17 Mar 2008 09:34

Please specify whether you have set Direct or UseUnicode options of TOraSession. Also specify the character set of your database.

xalion
Posts: 124
Joined: Fri 20 May 2005 10:08

Post by xalion » Tue 18 Mar 2008 02:57

I use dircet mode.
and useunicode:=False
and my oracle character set is ZHS16GBK

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 18 Mar 2008 13:02

We have reproduced this problem, and we are working on it. You will be notified when we fix the problem.

Post Reply