Subject | RE: [ib-support] Blob Field |
---|---|
Author | Thomas Steinmaurer |
Post date | 2003-01-05T18:26:22Z |
> Oh, well, that is a show-stopper!. I simply assumed that the database knewYou can't do that with an INSERT INTO statement directly. You'll have
> that it should retrieve the binary content from that path and file name.
>
> Could you let me have the correct SQL for the insert?
to use a parametrized query in your client application.
For example (using an IBO TIB_DSQL):
with IB_DSQL1 do begin
Close;
SQL.Text := 'INSERT INTO ResGraphs (setupNo, ph1Graph) VALUES (:setupNo, :ph1Graph);'
Prepare;
ParamByName('setupNo').AsInteger := 1;
ParamByName('ph1Graph').LoadFromFile('d:\multimedia\pictures\signature.bmp');
Execute;
end;
HTH,
Thomas Steinmaurer
IB LogManager 2.1 - The Logging/Auditing Tool for InterBase and Firebird
http://www.iblogmanager.com
> hwc
> -----Original Message-----
> From: Thomas Steinmaurer [mailto:ts@...]
> Sent: Sunday, January 05, 2003 12:24 PM
> To: ib-support@yahoogroups.com
> Subject: RE: [ib-support] Blob Field
>
>
> Hello Hans-Wolfgang,
>
> > Hier ist das snippet:
> >
> > insert into ResGraphs ( setupNo, ph1Graph ) values ( 1,
> > 'd:\multimedia\pictures\signature.bmp' );
>
> Well, with the above INSERT statement, you simply insert
> the string 'd:\multimedia\pictures\signature.bmp' into
> your BLOB field, but not the "true" bitmap from your HDD
> at the given location.
>
> Regards,
> Thomas Steinmaurer
> IB LogManager 2.1 - The Logging/Auditing Tool for InterBase and Firebird
> http://www.iblogmanager.com
>
> > jwc (Hans-Wolfgang)
> > -----Original Message-----
> > From: Thomas Steinmaurer [mailto:ts@...]
> > Sent: Sunday, January 05, 2003 9:18 AM
> > To: ib-support@yahoogroups.com
> > Subject: RE: [ib-support] Blob Field
> >
> >
> > Hi Jack,
> >
> > > I have created a FB database, one table of which has blobs. The blob
> > fields
> > > are set with subtype 0 (binary). I populated the table with several
> > > different .bmp's using the insert query, which succeeds.
> > >
> > > Now I would like to view the contents of the blob with a Delphi
> database
> > > app. I have used two different data access component sets (tIB_ and
> > tIBO).
> > > Both fail with the error, "Bitmap image is not valid". Since the
> error
> > is
> > > repeated in both cases, I am inclined to suspect that I have not set
> up
> > the
> > > table properly.
> >
> > By using a BLOB column with sub_type 0 you have set up your table
> > correctly.
> >
> > I guess you are using TDBImage for viewing the bitmap, right? If so, I
> > think
> > there went something wrong, when you have inserted the BMPs. How does
> your
> > above mentioned insert query look like? Any code snippets?
> >
> > Regards,
> > Thomas Steinmaurer
> > IB LogManager 2.1 - The Logging/Auditing Tool for InterBase and
> Firebird
> > http://www.iblogmanager.com
> >
> >
> >
> >
> >
> > Yahoo! Groups Sponsor
> > ADVERTISEMENT
> >
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > ib-support-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > ib-support-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
>
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>