Subject | How do load a BLOB file using an Update query |
---|---|
Author | |
Post date | 2015-02-11T15:49:35Z |
I have been using "LoadFromFile" in my Delphi apps to load a pdf file into 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');
qryUpdateManifestBLOB.SQL.Add('(');
qryUpdateManifestBLOB.SQL.Add(QuotedStr(fmWasteShipments.PathtoFile));
qryUpdateManifestBLOB.SQL.Add(')');
qryUpdateManifestBLOB.SQL.Add('WHERE');
qryUpdateManifestBLOB.SQL.Add('w_shipments.shipments_pk = ');
qryUpdateManifestBLOB.SQL.Add(ShipmentPK);
The code produced this sql statement
UPDATE
w_shipments
SET
w_shipments.US_manifest_doc =
LoadFromFile
(
'C:\Users\ccox.COXCOLVIN\Desktop\FedEx Form.pdf'
)
WHERE
w_shipments.shipments_pk =
'585'