Subject | Re: Beginner needs help |
---|---|
Author | john |
Post date | 2008-01-31T23:06:39Z |
> > I need to store an image to a to the DB and I can't seem tofigure it
> > out. I'd like to use SQL directly in the SQL Editor if possible.to
> >
> > Again, I'm sorry for the simple question, but I just can't seem
> > get the SQL syntax down right.Adam,
>
> John,
>
> Officially, there is no command line to do it through iSQL. Any
> application can do it using a trivial paramatised query, but it is a
> bit harder from the command line.
>
> There are however third party tools that probably do something like
> what you want. For example, FSQL:
>
> http://www.volny.cz/iprenosil/interbase/fsql.htm
>
> You can run a query like:
>
> INSERT INTO tab(id, pict, thumb) VALUES (1, @'c:\pict.jpg',
> @'c:\smallpict.jpg');
>
> It is not official SQL Standard or official Firebird sanctioned
> syntax, but useful nonetheless.
>
> Adam
>
Thanks for your response. I appreciate it.
I don't think my boss will go for FSQL. So I'll to figure it out in
DELPHI.
Does anyone know if this code snipet from Jiri(posted Oct 5, 2005:
http://tech.groups.yahoo.com/group/firebird-support/message/67161)
can be updated for
IDE: CodeGear RAD Studio for .NET
Language: DELPHI 8.0
DB: Firebird 2.0
Provider: Firebird Version 2.0.1 for .NET 2.0
Code from previous post:
"
IBQueryTmp.SQL.Clear;
IBQueryTmp.SQL.Add('INSERT INTO table');
IBQueryTmp.SQL.Add('(img) VALUES (:img)');
IBQueryTmp.Params[0].DataType := ftBLOB;
IBQueryTmp.Params[0].Value := Null;
IBQueryTmp.Params[0].LoadFromFile(ImagePath, ftBlob);
if not(IBQueryTmp.Prepared) then
IBQueryTmp.Prepare;
IBQueryTmp.ExecSQL;
"
Thanks,
-John