Subject Re: [ib-support] LOAD EXTERNAL FILE FOR FIREBIRD BLOB
Author ibrahim Bulut
I must load a text file into a blob.
Can I Do it with udf.
How Can I Do It


Ibrahim Bulut
Software Developer
Republic of Turkey

----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <ib-support@yahoogroups.com>
Sent: Monday, June 17, 2002 3:48 PM
Subject: Re: [ib-support] LOAD EXTERNAL FILE FOR FIREBIRD BLOB


> At 10:50 AM 17-06-02 +0300, Ibrahim Bulut wrote:
> >hi
> >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
> >Memo1.Loadfromfile('C:\MyTextFiles\Report.Dfm').
> >
> >Can we do it with firebirdsql.
> >Like
> >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
> >CREATE DOMAIN RDB$EXTERNAL_DESCRIPTION AS BLOB SUB_TYPE
> >EXTERNAL_FILE_DESCRIPTION SEGMENT SIZE 80;
> >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.
>
> heLen
>
> All for Open and Open for All
> Firebird Open SQL Database · http://firebirdsql.org ·
> http://users.tpg.com.au/helebor/
> _______________________________________________________
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>