TOracleDataset cannot read LONG column in UTF8 database

plpolak

Member²
I have a Oracle 9.2.0.6 UTF8 database (AL32UTF8) on Windows. When I select data from a LONG column in the data returned by TOracleDataset in a Delphi string contains all the characters of the LONG value, but after each a #0 character is inserted. Effectively this causes most Delphi functions to terminate the string after the first character.

I use this to initialize TOracleSession:

AutoCommit := False;
BytesPerCharacter := bcAutodetect;
Preferences.ConvertUTF := cuUTF8ToUTF16;
Preferences.FloatPrecision := 15;
Preferences.TemporaryLOB := tlNone;
Preferences.TrimStringFields := False;

I use DOA 4.1, Delphi 2007 for Win32 (update 1). The error occurs with Oracle 9.2 client and 10.2 client on Windows.

It can be easily reproduced by using this query:
select search_condition from dba_constraints
This returns a LONG column, and is not returned correctly by DOA.

I there a way to fix this, or work around it?

regards,

Pieter
 
Back
Top