Subject | Re: [firebird-support] How do load a BLOB file using an Update query |
---|---|
Author | Martijn Tonies (Upscene Productions) |
Post date | 2015-02-11T16:24:02Z |
Hi Craig,
is executed by the Firebird database engine. And that engine cannot execute
Delphi code.
Use a parameter:
SQL.Add('SET myblobcol = :newblob');
and of course the primary key stuff.
Call:
qryUpdateManifestBLOB.Prepare;
qryUpdateManifestBLOB.ParamByName('newblob').LoadFromFile
qryUpdateManifestBLOB.ExecSQL;
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
>I have been using "LoadFromFile" in my Delphi apps to load a pdf file intoWell, this obviously won't work, because whatever is in the .SQL property,
>my Firebird databases. However, I need to replicate this using an update
>query.
>The code below was my first attempt. Using IBOjects within Delphi
> qryUpdateManifestBLOB.SQL.Clear;
> qryUpdateManifestBLOB.SQL.Add('UPDATE');
> qryUpdateManifestBLOB.SQL.Add('w_shipments');
> qryUpdateManifestBLOB.SQL.Add('SET');
> qryUpdateManifestBLOB.SQL.Add('w_shipments.US_manifest_doc =');
> qryUpdateManifestBLOB.SQL.Add('LoadFromFile');
is executed by the Firebird database engine. And that engine cannot execute
Delphi code.
Use a parameter:
SQL.Add('SET myblobcol = :newblob');
and of course the primary key stuff.
Call:
qryUpdateManifestBLOB.Prepare;
qryUpdateManifestBLOB.ParamByName('newblob').LoadFromFile
qryUpdateManifestBLOB.ExecSQL;
>which Firebird did not like because "LoadToFile" is an unknown function.See above.
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!