[fpc-pascal] EDatabaseError on SELECT

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Feb 10 16:47:25 CET 2016


Hello,

Taking advantage that we are already talking about SQL .... how to
upload the contents of a blob field?

I tried using a SELECT to get the field +
TBlobField(FQuery.FieldByName('Data')).LoadFromStream but it raises an
exception that "Dataset is not in insert or edit mode"

I see that I could write the data in hexadecimal in the SQL query, but
that would be slow...

So what is the proper way to use TBlobField.LoadFromStream?

Or should I use params + an SQL statement with question mark:

lSQL := Format('UPDATE %s SET ? WHERE ID=''%d''', [lTableName, AItemNr]);

?

thanks,
-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list