Subject Re: Converting a JPEG to a blob...
Author Adam
> My SQL Workbench/J (similar tool as your Database Workbench but Java
> based) can do that completely on the client side with a special SQL
> syntax very similar to the UDF solution.
> But as the code is executed on the client side, the application will
> take care of "uploading" the BLOB to the server (and directly into the
> column).
>
> INSERT INTO theTable (id, blob_col)
> VALUES
> (42,{$blobfile=c:/data/image.bmp});
>
> This works for any database where the JDBC driver implements the
> necessary functions, including Firebird. This can also be run in batch
> mode.

As I mentioned here:
http://tech.groups.yahoo.com/group/firebird-support/message/79665

There is already a script running program similar to iSQL that
supports inserting blobs.

http://www.volny.cz/iprenosil/interbase/fsql.htm

The UDF 'solution' may work, but as Martijn points out, the path is
relative to the server which means you must dump the files onto the
server or setup a share on the client - hardly ideal. There may be
some limited applications where it is useful, but it is not a total
solution for client side scripting.

>
> The same syntax can also be used to "upload" files into CLOB columns
> Although I'm not sure which datatype that would be for Firebird. Does
> Firebird have a character datatype that can hold more than 32K?

BLOB SUB_TYPE TEXT = CLOB

Adam