How to extract blob files in Firebird?

Asked

Viewed 5,427 times

3

I have in a table a field of type BLOB(BLOB SUB_TYPE 0 SEGMENT SIZE 80) where I store some binary files.
I need to extract all the files stored in that table. Through Ibexpert in the "Data/Form view" tab is displayed a field where I can right click on "Save to file" option and save this file normally.

Now I own thousands of records files must be extracted.

Is there any way through Ibexpert or your script tool Ibescript where can I extract all these files at once? Is there any other tool that I can do this?

Note: I even managed to extract these files through the function ibec_ExtractMetadata from Ibexpert itself, however, it extracts all the files from table I only one file in Hexadecimal format, the extension of this file is .lob. I could not proceed to convert it to binary file.
Note: In the last case I will create a program through Delphi to extract these files.

  • In case of error, try increasing the varchar field from 80 to 1000.

2 answers

2

As far as I know, this is not possible for individual files. Ibexpert has ways to export the blob files to a file of type .lob. But the idea is that they are used for import in another BD and not for individual use. See the following links: http://ibexpert.net/ibe/index.php?n=Doc.ImportAndExportUsingIBExpert2 http://ibexpert.net/ibe/index.php?n=Doc.ExtractMetadata#ExtractBlobs

But in this case you could also use Fbexport: http://www.firebirdfaq.org/faq86/

There is no automated way to export these files like this. Maybe it would be better if you wrote your own application in any language to do it.

1

You can do the following, maybe it will help you...

Run the following SQL in Ibexpert:

select cast(*campo* as varchar(80))
from *tabela*
where *campo* is not null

After you will have the values in text format, then you can export to a TXT, Excel, CSV file... As you prefer...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.