Subject | RE: [IBO] Passing Blobs to an Insert or Update Query |
---|---|
Author | Jason Wharton |
Post date | 2004-06-08T06:18:37Z |
Please don't use any hard typecasts if you can help it. They just turn
around and bite you. There ought to be a LoadFromFile method without having
to do that. You might also use a TFileStream and then use the Assign method
to assign from it.
Jason Wharton
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Monday, June 07, 2004 9:25 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Passing Blobs to an Insert or Update Query
At 03:18 AM 8/06/2004 +0000, you wrote:
between the vcl units db.pas (which the TIBO components use) and DBTables
(which TIBO does not use).
Try
TIB_ColumnBlob(ParamByName('BARCODE')).LoadFromFile(sJPEGFile);
An unsolicited comment on your code here: why waste resources by assigning
SQL at runtime and not parameterising *both* of these inputs?
Helen
around and bite you. There ought to be a LoadFromFile method without having
to do that. You might also use a TFileStream and then use the Assign method
to assign from it.
Jason Wharton
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Monday, June 07, 2004 9:25 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Passing Blobs to an Insert or Update Query
At 03:18 AM 8/06/2004 +0000, you wrote:
>Hmmm.... I can't seem to pass blobs to an update or insert query.I seem to recall there's a problem with TBlobField due to some dependency
>Any ideas?
>
> sQ :=
> 'INSERT into SIGNATURES ' +
> '(SINVLOOKUP, BARCODE) Values '+
> '('+ QuotedStr(sInvLookup) + ', :Barcode)';
> Active := False;
> SQL.Clear;
> SQL.Add(sQ);
> TBlobField(ParamByName('BARCODE')).LoadFromFile(sJPEGFile);
> Active := True;
between the vcl units db.pas (which the TIBO components use) and DBTables
(which TIBO does not use).
Try
TIB_ColumnBlob(ParamByName('BARCODE')).LoadFromFile(sJPEGFile);
An unsolicited comment on your code here: why waste resources by assigning
SQL at runtime and not parameterising *both* of these inputs?
Helen