Author Helen Borrie
At 10:50 AM 17-06-02 +0300, Ibrahim Bulut wrote:
>we are using firebird and delphi 5 ent.
>we have a problem.
>There is an external file which name is ('C:\MyTextFiles\Report.Dfm').
>in delphi, we can load this file into a memo
>Can we do it with firebirdsql.
>Select Loadfile('C:\MyTextFiles\Report.Dfm') from rdb$database;
>Database will find the file, and load it to a text blob file.

No. The database can handle an external file with rows in fixed length
columns; and it can accept a string as input to a blob column in an SQL
INSERT or UPDATE statement. Everything it does, it does with SQL. You
can't load data into the database with a SELECT statement, either, except
when inserting into or updating one table by sub-selecting from another table.

Also, the database doesn't save any data as "files". It stores and manages
blob data on database pages, within the database file itself.

>in ibconsole,
>when i was browsing the RDB$RELATIONS table,
>i saw a domain
>can we load external file with this blob type

The database engine uses several different blob sub-types for massaging and
managing metadata.

The sub_types available to the programmer are sub_type 0 (generally, any
streamed data, typically binary) and sub_type 1 (text).

You can also create your own sub_types by writing one or more blob filters
- a specialised UDF that picks up blob data stored in a particular format
and converts it (for output or storage) to another format. For example,
you could have a blob column in which you always store bitmapped images and
you could write a blob filter to convert them to JPEG or GIF. Where they
differ from UDFs is that you declare them to the database as blob
sub-types, rather than as functions.

Delphi is rich with features for converting streamed data (from memory or
from files) into blobs and then you just pass them to the database as
blob. IB Objects has some highly specialised methods for doing it
directly. I won't go into the details here as it's off-topic. Consult the
Delphi help and the Borland knowledgebase, on both blobs and streams.


All for Open and Open for All
Firebird Open SQL Database · ·