Page 1 of 1

Blob problem

Posted: Fri 17 Oct 2008 06:33
by SvenH
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!

Posted: Fri 17 Oct 2008 07:35
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 17 Oct 2008 08:45
by SvenH
Sample code sent.

Posted: Tue 21 Oct 2008 08:19
by SvenH
Are there any news?

Could you reproduce the problem?

Posted: Wed 22 Oct 2008 08:08
by Plash
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.

Posted: Thu 23 Oct 2008 06:46
by SvenH
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!