Page 1 of 1

Assertion failure with StoredProc, null BLOB field

Posted: Wed 01 Aug 2012 08:43
by borax1974
Hi

I'm getting a
Assertion failure (D:\Projects\Delphi\Dac\Oracle\Source\OraClasses.pas, line 5339).
error when loading a zero size stream to a Blob parameter of a StoredProc.

Code I'm using (which works perfectly when stream size > 0) is

StrProc.ParamByName(FieldName).LoadFromStream(Stream, ftOraBlob)

ODAC 7.20.0.8, Delphi XE

Bora Aydemir

Re: Assertion failure with StoredProc, null BLOB field

Posted: Wed 01 Aug 2012 09:39
by AlexP
hello,

We cannot reproduce the problem.
You are using a rather old ODAC version, try updating your version to the latest 8.2.8, it may solve the problem.

Re: Assertion failure with StoredProc, null BLOB field

Posted: Wed 01 Aug 2012 10:57
by borax1974
Unfortunately I'm a bit busy upto October and I don't have time to upgrade and test my projects with new ODAC version. Is there a way to send null value to blob field of the stored. I tried

1. not setting the parameter, which didn't work
2. StrProc.ParamByName(FieldName).AsString := #0; but when the stored saves this data to a table, I have 00 as data in blob field of the table, where as I need it to be null.

Best regards

Re: Assertion failure with StoredProc, null BLOB field

Posted: Wed 01 Aug 2012 14:06
by AlexP
hello,

To make the parameter value equal NULL, you can either set no value, or use one of the following constructions:

OraQuery1.ParamByName('ParamName').Clear;
OraQuery1.ParamByName('ParamName').AsString := EmptyStr;