Subject | RE: [IBO] No way to append to BLOBs using CreateBlobStream |
---|---|
Author | IBO Support List |
Post date | 2012-11-15T23:40Z |
FYI, I was able to isolate and fix this bug. It will be in the next
sub-release. (Build 54)
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of IBO Support List
Sent: 14 November 2012 06:04 AM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] No way to append to BLOBs using CreateBlobStream
Attachments don't make it through the list.
Please send it to me via private email.
Thanks,
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Marko Myllymäki
Sent: 14 November 2012 04:00 AM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] No way to append to BLOBs using CreateBlobStream
Wonderful, thanks Jason! The sample app and the sample DB is attached. The
DB is expected to be located in C:\IBOBLOBTest.
Looking forward to your analysis.
Best regards,
Marko
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of IBO Support List
Sent: Tuesday, November 13, 2012 6:16 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] No way to append to BLOBs using CreateBlobStream
There are a number of different factors that can influence BLOB handling.
If you send me a sample app I'll work on this immediately.
Thanks,
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>
[mailto:IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>] On
Behalf
Of mjmyllym
Sent: 13 November 2012 04:38 AM
To: IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>
Subject: Re: [IBO] No way to append to BLOBs using CreateBlobStream
Hi,
This below issue is still unresolved. Seems like a bug in IBO because it is
so easy to reproduce. I can send the project and example database for
analysis?
This is crucial for my project and so far it is the only (but showstopping)
obstacle in taking the otherwise-so-wonderful IBO into use.
Thank you for help in advance.
Regards,
Marko
--- In IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>,
"mjmyllym" <marko.myllymaki@...<mailto:marko.myllymaki@...>> wrote:
stream with the buffer) I now get an error "Record was not located to
update."
Behalf
__________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
__________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links
sub-release. (Build 54)
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of IBO Support List
Sent: 14 November 2012 06:04 AM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] No way to append to BLOBs using CreateBlobStream
Attachments don't make it through the list.
Please send it to me via private email.
Thanks,
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Marko Myllymäki
Sent: 14 November 2012 04:00 AM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] No way to append to BLOBs using CreateBlobStream
Wonderful, thanks Jason! The sample app and the sample DB is attached. The
DB is expected to be located in C:\IBOBLOBTest.
Looking forward to your analysis.
Best regards,
Marko
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of IBO Support List
Sent: Tuesday, November 13, 2012 6:16 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] No way to append to BLOBs using CreateBlobStream
There are a number of different factors that can influence BLOB handling.
If you send me a sample app I'll work on this immediately.
Thanks,
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>
[mailto:IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>] On
Behalf
Of mjmyllym
Sent: 13 November 2012 04:38 AM
To: IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>
Subject: Re: [IBO] No way to append to BLOBs using CreateBlobStream
Hi,
This below issue is still unresolved. Seems like a bug in IBO because it is
so easy to reproduce. I can send the project and example database for
analysis?
This is crucial for my project and so far it is the only (but showstopping)
obstacle in taking the otherwise-so-wonderful IBO into use.
Thank you for help in advance.
Regards,
Marko
--- In IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>,
"mjmyllym" <marko.myllymaki@...<mailto:marko.myllymaki@...>> wrote:
>was a typo because I tried that too.
> Jason,
>
> Thanks, but yes I did try bsmReadWrite. Using bsmWrite in the example code
>changes in the middle part (where I try to rewrite the beginning of the
> bsmReadWrite results in the exact same behavior: stream of size 0.
>
> Then, even more, running the same routine twice and trying to .Post the
stream with the buffer) I now get an error "Record was not located to
update."
>('datax'), bsmRead));
> See below for latest code.
>
> Any new ideas?
>
> Marko
>
>
> procedure TForm1.Button5Click(Sender: TObject);
> var
> Buff : array of byte;
> F : TField;
> St : TIB_BlobStream;
> I : integer;
> begin
> SetLength (Buff, 10);
> for I := 0 to 10 do Buff [I] := I;
>
> IB_Query1.SQL.Text := 'select * from curvey where rown = 2';
> IB_Query1.Open;
> St := TIB_BlobStream (IB_Query1.CreateBlobStream (IB_Query1.FieldByName
> ShowMessage (IntToStr (St.Size)); // => Result in "0" on the firstround, "10" on the second
> St.Free;bsmReadWrite);
>
> IB_Query1.Close;
> IB_QUery1.RequestLive := true;
> IB_Query1.Open;
> IB_Query1.Edit;
>
> St := TIB_BlobStream.CreateForColumn (IB_Query1.FieldByName ('datax'),
>('datax'), bsmReadWrite));
> ShowMessage (IntToStr (St.Size)); // => Result in "0"
> St.Seek (0, soFromBeginning);
> St.WriteBuffer (Buff [0], 10);
> ShowMessage (IntToStr (St.Size)); // => Results in "10"
> IB_Query1.Post; // Error here on 2nd round
> St.Free;
>
> IB_Query1.Close;
> IB_QUery1.RequestLive := true;
> IB_Query1.Open;
> IB_Query1.Edit;
>
> St := TIB_BlobStream (IB_Query1.CreateBlobStream (IB_Query1.FieldByName
> ShowMessage (IntToStr (St.Size)); // => Results in "0"though there is data
> St.Seek (0, soFromEnd);
> ShowMessage (IntToStr (St.Position)); // => Results in "0" even
>Support List" <supportlist@> wrote:
> St.WriteBuffer (Buff [0], 10);
> IB_Query1.Post;
> St.Free;
> end;
>
>
>
>
>
> --- In IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>, "IBO
> >[mailto:IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>] On
> > bmWrite clears out previous information.
> >
> > Did you try bmReadWrite?
> >
> > Jason
> >
> > -----Original Message-----
> > From: IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>
Behalf
> > Of mjmyllymappend.
> > Sent: 07 November 2012 08:32 AM
> > To: IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>
> > Subject: [IBO] No way to append to BLOBs using CreateBlobStream
> >
> > Hello,
> >
> > I have a critical problem in appending data to binary BLOBs using
> > CreateBlobStream.
> >
> > I am using IBO4_9_14_b52, Delphi 6. Tried both Firebird 2.1 and 2.0;
> > different BLOB types etc.
> >
> > The thing is I can read from a BLOB and write to a BLOB but cannot
> > Opening a BLOB with existing data with CreateBlobStream incannot
> > bsmWrite/bsmReadWrite mdoe always results in a stream of size 0! So I
> > seek the stream and append to the end. If I look at the query's data inworks),
> > string format I can see the existing data but not in Stream format.
> >
> > Very simple database:
> >
> > create table curves (
> > rown integer,
> > datax blob sub_type 0,
> > primary key (rown));
> >
> > Then, I have a form with TIBODatabase, IBOQuery or IB_Query (neither
> > and a simple test that first reads from a BLOB (ok), then writes asimple
> > array of byte data to a BLOB (ok) and finally tries to append to it =>(IB_Query1.FieldByName
> > fails.
> >
> > procedure TForm1.Button5Click(Sender: TObject);
> > var
> > Buff : array of byte;
> > F : TField;
> > St : TIB_BlobStream;
> > I : integer;
> > begin
> > SetLength (Buff, 10);
> > for I := 0 to 10 do Buff [I] := I;
> >
> > // First read from the BLOB, might be empty
> > IB_Query1.SQL.Text := 'select * from curves where rown = 1';
> > IB_Query1.Open;
> > St := TIB_BlobStream (IB_Query1.CreateBlobStream
> > ('datax'), bsmRead));first
> > ShowMessage (IntToStr (St.Size)); // => Result in "0" on the
> > round, "10" on the second(IB_Query1.FieldByName
> > St.Free;
> >
> > // Then write to:
> > IB_Query1.Close;
> > IB_QUery1.RequestLive := true;
> > IB_Query1.Open;
> > IB_Query1.Edit;
> >
> > St := TIB_BlobStream (IB_Query1.CreateBlobStream
> > ('datax'), bsmReadWrite));(IB_Query1.FieldByName
> > ShowMessage (IntToStr (St.Size)); // => Result in "0"
> >
> > St.WriteBuffer (Buff [0], 10);
> > ShowMessage (IntToStr (St.Size)); // => Results in "10", as it
> > should
> > IB_Query1.Post;
> > St.Free;
> >
> > // Now let's try to append:
> > IB_Query1.Close;
> > IB_QUery1.RequestLive := true;
> > IB_Query1.Open;
> > IB_Query1.Edit;
> >
> > St := TIB_BlobStream (IB_Query1.CreateBlobStream
> > ('datax'), bsmWrite));there
> > ShowMessage (IntToStr (St.Size)); // => Results in "0".. like
> > is no data!the
> >
> > St.WriteBuffer (Buff [0], 10);
> > IB_Query1.Post;
> > St.Free;
> > end;
> >
> >
> > Frustrating.
> >
> > I CAN append to the blob if I use e.g.
> >
> > St := TMemoryStream.Create;
> > TBlobField (F).SaveToStream (St);
> > ...
> > St.WriteBuffer (Data, Length);
> > TBlobField (F).LoadFromStream (St);
> >
> > but this is very ineffective because I need to write to the BLOBs all
> > time, i.e. several times a minute. Also this results in a huge database__________________________________________________________
> > bloating.
> >
> > Thank you in advance for help.
> >
> > Best regards,
> > Marko Myllymaki
> >
> >
> >
> >
> > ------------------------------------
> >
> >
> > IB Objects - direct, complete, custom connectivity to Firebird orInterBase
> > without the need for BDE, ODBC or any other layer.__________________________________________________________
> >
> > http://www.ibobjects.com - your IBO community resource for Tech Infopapers,
> > keyword-searchable FAQ, community code contributions and more !------------------------------------
> > Yahoo! Groups Links
> >
>
__________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
__________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links
[Non-text portions of this message have been removed]
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links