CLOB cell blanked out - problem report + particular solution

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
heidenbluth
Posts: 56
Joined: Mon 08 Nov 2004 19:01
Location: Germany

CLOB cell blanked out - problem report + particular solution

Post by heidenbluth » Tue 07 Dec 2004 21:01

Hello,

I had some trouble with CLOB fields, and in the meanwhile I found a particular solution. Lets consider a TSmartQuery component having DMLRefresh=True and showing data from a query against a table like
CREATE TABLE INDEP
( ID NUMBER NOT NULL,
CL CLOB,
TXT VARCHAR2 (30));
ALTER TABLE INDEP ADD ( CONSTRAINT INDEP_PK PRIMARY KEY (ID))

It displays the result set in an InfoPower grid (www.woll2woll.com) that is able to display even clob values in its cells. If you edit a value from the TXT column without clicking any other cell before and then post the change, the value of the clob cell is blanked out. At first it looks like a problem of display only. Unfortunately the next edit/post cycle clears also the clob in the database.

Now I got a clue that the problem depends on the setting of TSmartQuery.DMLRefresh. That lead me to the TCustomSmartQuery.GetUpdateSQL function in OraSmart.pas line 1586. I changed it as follows and made my customer happy:

if not AFieldDesc.ReadOnly and not AFieldDesc.HasParent
and (FDMLRefresh and not (AFieldDesc.DataType in [dtMemo,dtBlob,dtOraBlob,dtOraClob,dtBFile,dtCFile])

In behalf of my problem it was sufficient to add dtOraClob. After looking at TOCIRecordSet.IsBlobFieldType(..) I decided to be safe and added all blob field types.

I am afraid you intended to make clob field values returnable too, because dtOraLob appears some lines below again. I am sure you will find a solution that considers that too.

Regards, Holger

PS.: TSmartquery properties are set as follows
SmartQuery1.DMLRefresh := True;
SmartQuery1.Lockmode := lmNone;
SmartQuery1.NonBlocking := True;
SmartQuery1.Options.CacheLobs := False;
SmartQuery1.Options.DeferredLobRead := True;
Last edited by heidenbluth on Thu 09 Dec 2004 15:43, edited 2 times in total.

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 14 Dec 2004 16:41

We got your request and sample project by mail
and now examines the problem. Unfortunately now we couldn't give you any information.
As soon as we solve the problem, we'll let you know

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Wed 05 Jan 2005 10:53

We found that RETURNING with Lobs does not work in Oracle 9i. So your solution is acceptable for this situation.

Post Reply