Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: why i have #0 between all my carracters
why i have #0 between all my carracters
Posted: 2007/09/03 03:31
 
i work with an Tadquery and i connect on a Oracle clob and i want to read the clob:

amemo:=myadquery.fieldbynam('MyOraClobField').asstring;

but if my string in the clob is for example ' TOTO' i have the result
'T'#0'O'#0'T'#0'O'

this is like C ??

i think this depend on a parameter, but i doesn't found it.

Could you help me?
Re:why i have #0 between all my carracters
Posted: 2007/09/03 06:54
 
Try not asstring, but aswidestring.
Re:why i have #0 between all my carracters
Posted: 2007/09/03 07:27
 
sorry but i'm under delphi 5 and the aswidestring doesn't exist
Re:why i have #0 between all my carracters
Posted: 2007/09/04 01:24
 
1) Could you verify using SQL*Plus, that data in table is correct ? IOW, that CLOB really contains 'TOTO' ?
2) Additionally I need:
- your CREATE TABLE
- result of your SELECT * FROM v$nls_parameters WHERE parameter LIKE '%CHARACTERSET'
- Oracle version

Regards,
Dmitry
Re:why i have #0 between all my carracters
Posted: 2007/09/04 05:17
 
1) of course the text 'TOTO' is correct in table

2) NLS_CHARACTERSET=UTF8
and
NLS_NCHAR_CHARACTERSET= UTF8

3) my oracle is 9

i try to pass the problem with :

                      CurMess:='';                     := ADQ.FieldByName('MESSAGE').AsString;                     for := 1 to Length(s) do                      if s[i] <> #0 then                        CurMess := CurMess s[i];



but the Curmess variable contains after all only the first part of the real clob, becose the length delphi's function doesn't count the #0

I'm turning around, thank you for your interest.

Post edited by: korntex5, at: 2007/09/04 05:17

Post edited by: korntex5, at: 2007/09/04 05:18

Post edited by: korntex5, at: 2007/09/04 05:19

Post edited by: korntex5, at: 2007/09/04 05:20
Re:why i have #0 between all my carracters
Posted: 2007/09/04 05:47
 
The problem is that "ADQ.FieldByName('MESSAGE').AsString" command doesn't return the full clob, it cut at the true length of string becose of the #0 between the carracters.

In reality this command on 'TOTO' string return 'T'#0'O'#0

Post edited by: korntex5, at: 2007/09/04 05:53
Re:why i have #0 between all my carracters
Posted: 2007/09/05 03:35
 
in NCOCI8, the astring function on my clob work perfectly without #0
and return 'TOTO'

I think this is just a little bug in anydac evolution...
Re:why i have #0 between all my carracters
Posted: 2007/09/05 04:02
 
Hello

Thank you for reporting.

1) NCOCI8 does not support Unicode.
2) AnyDAC supports, but there was a bug. It is fixed and changes will be part of 2.0.

Regards,
Dmitry