Page 1 of 1

TMemoField gets no value from CLOB column

Posted: Wed 09 Jul 2008 08:14
by Edmund Pfundstein
Hi,
since 6.50.0.34 23-May-08, I have a problem with TORAQUERY, TMemoField and CLOB column in table. I develop with Delphi 7 and Oracle 10g. I get no value from TMemoField in following cases, look at the example:

CorOraQuery2.SQL.Text := 'select ID, SPRACHTEXT from t_langtexte where id = 83';

// 1. -> no value from TMemoField SPRACHTEXT
// CorOraQuery2.OptionsDS.CacheLobs := false;
// CorOraQuery2.OptionsDS.DeferredLobRead := true;

// 2. -> no value from TMemoField SPRACHTEXT
// CorOraQuery2.OptionsDS.CacheLobs := true;
// CorOraQuery2.OptionsDS.DeferredLobRead := true;

// 3. Works fine -> value from TMemoField SPRACHTEXT
CorOraQuery2.OptionsDS.CacheLobs := true;
CorOraQuery2.OptionsDS.DeferredLobRead := false;

// 4. -> no value from TMemoField SPRACHTEXT
// CorOraQuery2.OptionsDS.CacheLobs := false;
// CorOraQuery2.OptionsDS.DeferredLobRead := false;

CorOraQuery2.open;
Edi2.Text := cororaQuery2.fieldbyname('Sprachtext').asstring;
CorOraQuery2.Close;

In my application I use normally case 1 and get no value.

Thank you for your help.

Edmund Pfundstein

Posted: Thu 10 Jul 2008 07:32
by Plash
We could not reproduce the problem. Please send to odac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

Posted: Fri 11 Jul 2008 13:26
by Edmund Pfundstein
Hi,
thank you for your reply.

I checked my code again. What I found is, that you can reproduce the error situation with torasession.option.useunicode := true.

Below are Create Table and the Delphi 7 code for testing.

--
-- Create für Tabelle: T_LANGTEXTE
--
create table T_LANGTEXTE (
IDSPRACHE NUMBER(10,0) ,
ID NUMBER(10,0) ,
SPRACHTEXT CLOB ,
SORTTEXT VARCHAR2(20 CHAR)
)
tablespace TS_CORDATA;


procedure TForm1.ButShowFieldClick(Sender: TObject);
var
locOraSession: TOraSession;
begin
locOraSession := TOraSession.Create(nil);
with locOraSession do
try
Server := 'CORLOCAL';
HomeName := '';
LoginPrompt := false;
ConnectPrompt := false;
Schema := '......';
Username := '.....';
Password := '.....';

// UseUnicode = TRUE - Error Situation
Options.UseUnicode := true;

// UseUnicode = FALSE - NO Error
// Options.UseUnicode := false;

Connect;
with TOraQuery.create(nil) do
try
Session := locOraSession;
// 1. Do not work -> no value from TMemoField SPRACHTEXT
OptionsDS.CacheLobs := false;
OptionsDS.DeferredLobRead := true;
// 2. Do not work -> no value from TMemoField SPRACHTEXT
// OptionsDS.CacheLobs := true;
// OptionsDS.DeferredLobRead := true;
// 3. Work is ok -> value from TMemoField SPRACHTEXT
// OptionsDS.CacheLobs := true;
// OptionsDS.DeferredLobRead := false;
// 2. Do not work
// OptionsDS.CacheLobs := false;
// OptionsDS.DeferredLobRead := false;
SQL.Text := 'select ID, SPRACHTEXT from t_langtexte where id = 83';
Open;
Edi.Text := fieldbyname('Sprachtext').asstring;
Close;
finally
free;
end;
Disconnect;
finally
if assigned(locOraSession) then
FreeAndNil(locOraSession);
end;

end;

Thank you for your help.

Edmund Pfundstein

Posted: Mon 14 Jul 2008 07:33
by Plash
We have fixed this problem. The fix will be included in the next build of ODAC.