Subject Re: How to assign value to blob directly in SQL command
Author Jonathan Hull
Thanks Peter.

I would like to use a script file (eg mydata.sql) to populate a table
which has a binary blob field. This script can be run using isql.

For example, if I want to store a PDF document into a blob, the pdf
will contain binary data values with values like chr(0), chr(10) etc.
These values interfere with Firebird's processing of the command.This
is handled in other databases by preceeding binary characters with a \.

Is there a similar way to tell Firebird that the next character is
binary data without spitting the dummy?

Cheers,
Jono

--- In firebird-support@yahoogroups.com, "kfkong" <kfkong@y...> wrote:
> Jono,
> I don't know whether you are trying to insert directly from isql or
> is embedded. You may try to assign the binanry data into a variable
> and put an indicator to indicate what it is.
>
> Peter
>
> --- In firebird-support@yahoogroups.com, "Jonathan Hull" <jono@f...>
> wrote:
> > Hi all,
> > The following query works:
> >
> > insert into my_table (name_id, name_value) values
> ('1', 'o''mally');
> >
> > and will insert the name o'mally into the name_value field where
> > name_value is a BLOB. However it does not work when binary data
> is in
> > the statement. In MySQL and PostGreSQL a backslash (\) character
> can
> > be added in the SQL statement before apostrophy ('), before quote
> (")
> > and before null (chr(0)), and this works fine in those databases to
> > add binary to a blob field directly in SQL. Is there is similar
> > syntax for FireBird?
> >
> > Cheers,
> > Jono