Subject Re: [firebird-support] UDF for reading images into a blob.
Author Ivan Prenosil
> I have hit a bit a wall with writing a udf and I wonder if someone
> could help me. I recently found some code in this list for reading and
> writing file data into blobs in a udf.
> I'm interested in using this code to read an image off disk and
> return it as a blob field in a view. The contributed code does work as
> far as it will return an image blob. The only problem is it won't
> release the memory used until the connection is dropped.

When the blob is created, it is only "temporary blob".
It became "permanent blob" when you assign it to some table field.
Temporary blob is not tied with any table, only with transaction -
if you explicitely do Rollback, it should be cleaned.
But if you pass the blob directly to client, then it will remain remporary blob,
and if you do Commit, then it will remain part of db file (and even sweep
can't remove it, since it does not belong to any table) !!!