Blob problem

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
SvenH
Posts: 6
Joined: Fri 17 Oct 2008 06:16

Blob problem

Post by SvenH » Fri 17 Oct 2008 06:33

Hi,

I have found a strange behavior when writing blobs.

I have a TIBCQuery with TDataSetProvider and TClientDataSet and write the blob with CreateBlobStream method of TClientDataSet.

Everything works fine, until i try to write the same(identical binary stream) blob data to the blob field. Then the blob is updated with a NULL value.

Like this:
1) Insert record with blob value = $01$02$03 O.K.
2) Select record and update the blob value to $01$02$03$04 O.K.
3) Select record and update blob value to $01$02$03$04 Error -> a NULL value is written to the blob field and the blob field becomes empty!

Thanks!

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

Post by Plash » Fri 17 Oct 2008 07:35

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.

SvenH
Posts: 6
Joined: Fri 17 Oct 2008 06:16

Post by SvenH » Fri 17 Oct 2008 08:45

Sample code sent.

SvenH
Posts: 6
Joined: Fri 17 Oct 2008 06:16

Post by SvenH » Tue 21 Oct 2008 08:19

Are there any news?

Could you reproduce the problem?

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

Post by Plash » Wed 22 Oct 2008 08:08

We have reproduced the problem. It is caused by some bug in MIDAS. IBDAC receives from MIDAS incorrect value for the BLOB field on the ApplyUpdates call.

As a workaround you can to not set the ModifySQL property of the TIBCUpdateSQL component. In this case UPDATE statement will be generated automatically, and it will not contain fields if their values are unchanged.

SvenH
Posts: 6
Joined: Fri 17 Oct 2008 06:16

Post by SvenH » Thu 23 Oct 2008 06:46

Thank you very much!

You point me to the right direction.

I found this midas bug described already in 2003 !!!

To use the UpdateSQL you can do following:

type
TBlobSolvedCDS = class(TClientDataSet)

and after open the ClientDataSet you have to call:

TBlobSolvedCDS(DataSet as TClientDataSet).DSBase.SetProp(dspropINCLBLOBSINDELTA, MaxInt);

This includes the blob in updates and fixes the bug.

Thanks again for your help!

Post Reply