Error 104 in FB when using a Blob Field

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
skippy
Posts: 20
Joined: Fri 18 Sep 2009 09:42

Error 104 in FB when using a Blob Field

Post by skippy » Sun 14 Mar 2010 19:17

Hi,

I can't get a file saved in a blob field in a Firebird Database, here's the relevant code snippet:

// tblBinFILE is a TBlobField
// fn is a valid file name with complete path.

tblBin.Append;
tblBinFILENAME.AsString := fn;
tblBinTASK.AsInteger := id;
tblBinFILE.LoadFromFile(fn);
tblBin.Post;

I always get a

Dynamic SQL Error
SQL Error Code = -104
Token unknown - line 2, column 14
FILE.

I don't have any clue what's wrong :(

Can anybody help ?

TIA

malinsky
Posts: 32
Joined: Wed 20 Aug 2008 11:38

Re: Error 104 in FB when using a Blob Field

Post by malinsky » Mon 15 Mar 2010 07:08

Hi,

I use:

TBlobField(qTemplates.FieldByName('XLS')).LoadFromFile(FileName);

('XLS' = blob field).

PMal

skippy
Posts: 20
Joined: Fri 18 Sep 2009 09:42

Post by skippy » Mon 15 Mar 2010 08:50

...which is pretty much the same, isn't it ?

Falcon
Devart Team
Posts: 19
Joined: Tue 02 Feb 2010 10:40

Post by Falcon » Mon 15 Mar 2010 15:30

Set the TUniQuery.Options.QuoteNames property to True or change the field name from "File" to some other name please, because "file" is a reserved word in Interbase/Firebird.

skippy
Posts: 20
Joined: Fri 18 Sep 2009 09:42

Post by skippy » Mon 15 Mar 2010 21:03

:D

Thanks, works fine !!!

Post Reply